qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH v2 2/3] qcow2.py: Add required padding for head


From: Max Reitz
Subject: Re: [Qemu-stable] [PATCH v2 2/3] qcow2.py: Add required padding for header extensions
Date: Tue, 25 Nov 2014 18:23:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

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 <address@hidden>
---
  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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]