From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9H0d-0005J8-F7 for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:36:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9H0A-00070m-FX for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:36:35 -0500 Received: from e34.co.us.ibm.com ([32.97.110.152]:37916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9H0A-00070Y-8l for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:36:06 -0500 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 10:36:05 -0700 From: Michael Roth Date: Thu, 8 Jan 2015 11:34:25 -0600 Message-Id: <1420738472-23267-82-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 81/88] 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: qemu-stable@nongnu.org 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 (cherry picked from commit a163ac3f57b5baa117158f7c0488d276ba3377e2) 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