qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/21] qcow2: add .bdrv_load_autoloading_dirty_b


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-devel] [PATCH 09/21] qcow2: add .bdrv_load_autoloading_dirty_bitmaps
Date: Mon, 19 Dec 2016 14:54:37 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

16.12.2016 17:37, Max Reitz wrote:
On 14.12.2016 16:54, Vladimir Sementsov-Ogievskiy wrote:
07.12.2016 23:51, Max Reitz wrote:
On 22.11.2016 18:26, Vladimir Sementsov-Ogievskiy wrote:
Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They
are loaded when the image is opened and become BdrvDirtyBitmaps for the
corresponding drive.

Extra data in bitmaps is not supported for now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
   block/Makefile.objs  |   2 +-
   block/qcow2-bitmap.c | 663
+++++++++++++++++++++++++++++++++++++++++++++++++++
   block/qcow2.c        |   2 +
   block/qcow2.h        |   3 +
   4 files changed, 669 insertions(+), 1 deletion(-)
   create mode 100644 block/qcow2-bitmap.c

[...]

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
new file mode 100644
index 0000000..0f797e6
--- /dev/null
+++ b/block/qcow2-bitmap.c
@@ -0,0 +1,663 @@
[...]

+/* Check table entry specification constraints. If cluster_size is
0, offset
+ * alignment is not checked. */
+static int check_table_entry(uint64_t entry, int cluster_size)
+{
+    uint64_t offset;
+
+    if (entry & BME_TABLE_ENTRY_RESERVED_MASK) {
+        return -EINVAL;
+    }
+
+    offset = entry & BME_TABLE_ENTRY_OFFSET_MASK;
+    if (offset != 0) {
+        /* if offset specified, bit 0 must is reserved */
-must

+        if (entry & 1) {
+            return -EINVAL;
+        }
+
+        if ((cluster_size != 0) && (entry % cluster_size != 0)) {
Why would cluster_size be 0? Also, shouldn't it be offset instead of
entry?
the comment says: "If cluster_size is 0, offset alignment is not checked"
Oops, right. Is there any place where this function is called with
cluster_size being 0, though?

Hmm, I can't find it. Will remove this extra feature.

[...]


--
Best regards,
Vladimir




reply via email to

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