From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNNz-0002pB-2D for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:51:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQNNu-0006O4-30 for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:51:23 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:51605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNNt-0006NQ-Ua for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:51:18 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 16:51:17 -0500 From: Michael Roth Date: Tue, 24 Feb 2015 15:47:51 -0600 Message-Id: <1424814498-6993-17-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 16/43] qcow2.py: Add required padding for header extensions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-stable@nongnu.org, Stefan Hajnoczi From: Kevin Wolf 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 Reviewed-by: Max Reitz Message-id: 1416935562-7760-3-git-send-email-kwolf@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 8884dd1bbc5ce42cd657ffcbef3a477443468974) Signed-off-by: Michael Roth --- 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 + self.magic = magic self.length = length self.data = data -- 1.9.1