qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 06/22] qcow2: add dirty bitmaps extension


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH 06/22] qcow2: add dirty bitmaps extension
Date: Thu, 13 Oct 2016 15:18:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 12.10.2016 21:21, Max Reitz wrote:
On 11.10.2016 14:09, Vladimir Sementsov-Ogievskiy wrote:
On 01.10.2016 17:46, Max Reitz wrote:
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote:
Add dirty bitmap extension as specified in docs/specs/qcow2.txt.
For now, just mirror extension header into Qcow2 state and check
constraints.

For now, disable image resize if it has bitmaps. It will be fixed later.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
   block/qcow2.c | 83
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   block/qcow2.h |  4 +++
   2 files changed, 87 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index c079aa8..08c4ef9 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
[...]

@@ -162,6 +164,62 @@ static int
qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
               }
               break;
   +        case QCOW2_EXT_MAGIC_DIRTY_BITMAPS:
+            ret = bdrv_pread(bs->file, offset, &bitmaps_ext, ext.len);
Overflows with ext.len > sizeof(bitmaps_ext).

(ext.len < sizeof(bitmaps_ext) is also wrong, but less dramatically so.)

+            if (ret < 0) {
+                error_setg_errno(errp, -ret, "ERROR: bitmaps_ext: "
+                                 "Could not read ext header");
+                return ret;
+            }
+
+            if (bitmaps_ext.reserved32 != 0) {
+                error_setg_errno(errp, -ret, "ERROR: bitmaps_ext: "
+                                 "Reserved field is not zero.");
Please drop the full stop at the end.
what do you mean? goto to fail: here? or not stop at all, just print error?
The "." at the end of the message. :-)

(https://en.wikipedia.org/wiki/Full_stop)

Max

aha, cool. didn't know this. )

--
Best regards,
Vladimir




reply via email to

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