From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtJqN-0001dl-IR for qemu-devel@nongnu.org; Tue, 25 Nov 2014 12:24:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtJqH-0007hc-TS for qemu-devel@nongnu.org; Tue, 25 Nov 2014 12:24:03 -0500 Message-ID: <5474BB1F.10907@redhat.com> Date: Tue, 25 Nov 2014 18:23:43 +0100 From: Max Reitz MIME-Version: 1.0 References: <1416935562-7760-1-git-send-email-kwolf@redhat.com> <1416935562-7760-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1416935562-7760-3-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/3] qcow2.py: Add required padding for header extensions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: armbru@redhat.com, stefanha@redhat.com, qemu-stable@nongnu.org On 2014-11-25 at 18:12, Kevin Wolf wrote: > The qcow2 specification requires that the header extension data be > padded to round up the extension size to the next multiple of 8 bytes. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/qcow2.py | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py > index 2058596..9cc4cf7 100755 > --- a/tests/qemu-iotests/qcow2.py > +++ b/tests/qemu-iotests/qcow2.py > @@ -7,6 +7,10 @@ import string > class QcowHeaderExtension: > > def __init__(self, magic, length, data): > + if length % 8 != 0: > + padding = 8 - (length % 8) > + data += "\0" * padding So it does work that way, great. *g* > + > self.magic = magic > self.length = length > self.data = data Reviewed-by: Max Reitz