From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfBZS-0005YD-5O for qemu-devel@nongnu.org; Thu, 14 Jun 2012 11:03:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfBZN-0005fi-67 for qemu-devel@nongnu.org; Thu, 14 Jun 2012 11:02:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfBZM-0005f0-Tv for qemu-devel@nongnu.org; Thu, 14 Jun 2012 11:02:45 -0400 Message-ID: <4FD9FD0F.1000909@redhat.com> Date: Thu, 14 Jun 2012 17:02:39 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1339678698-17726-1-git-send-email-stefanha@linux.vnet.ibm.com> <1339678698-17726-3-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1339678698-17726-3-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: add qcow2.py set-feature-bit command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org 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 > > The bit number must be in the range [0, 64). > > Signed-off-by: Stefan Hajnoczi > --- > 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