From: Kevin Wolf <kw...@redhat.com> 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 <kw...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> Message-id: 1416935562-7760-3-git-send-email-kw...@redhat.com Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Kevin Wolf <kw...@redhat.com> (cherry picked from commit 8884dd1bbc5ce42cd657ffcbef3a477443468974) Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> (cherry picked from commit a163ac3f57b5baa117158f7c0488d276ba3377e2) Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> --- 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