qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: add qcow2.py set-feature-b


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: add qcow2.py set-feature-bit command
Date: Thu, 14 Jun 2012 17:02:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Am 14.06.2012 14:58, schrieb Stefan Hajnoczi:
> This new command sets feature bits in the image file header:
> 
>   qcow2.py set-feature-bit incompatible|compatible|autoclear <bit>
> 
> The bit number must be in the range [0, 64).
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  tests/qemu-iotests/qcow2.py |   23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py
> index e27196a..97f3770 100755
> --- a/tests/qemu-iotests/qcow2.py
> +++ b/tests/qemu-iotests/qcow2.py
> @@ -181,10 +181,33 @@ def cmd_del_header_ext(fd, magic):
>  
>      h.update(fd)
>  
> +def cmd_set_feature_bit(fd, group, bit):
> +    try:
> +        bit = int(bit, 0)
> +        if bit < 0 or bit >= 64:
> +            raise ValueError
> +    except:
> +        print "'%s' is not a valid bit number in range [0, 64)" % bit

Heh, open intervals on integers are nice. ;-)

Thanks, applied all to the block branch.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]