qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v12 05/17] qmp: Add block-dirty-bitmap-enable an


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v12 05/17] qmp: Add block-dirty-bitmap-enable and block-dirty-bitmap-disable
Date: Wed, 11 Feb 2015 11:26:40 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015-02-09 at 20:35, John Snow wrote:
This allows to put the dirty bitmap into a disabled state where it is
read only. A disabled bitmap will ignore any attempts to set or reset
any of its bits, but can otherwise be renamed, deleted, or re-enabled.

It will be used before backup or writing to persistent file.

Signed-off-by: Fam Zheng<address@hidden>
Signed-off-by: John Snow<address@hidden>
---
  block.c               | 25 +++++++++++++++++++++++++
  blockdev.c            | 40 ++++++++++++++++++++++++++++++++++++++++
  include/block/block.h |  3 +++
  qapi/block-core.json  | 28 ++++++++++++++++++++++++++++
  qmp-commands.hx       | 10 ++++++++++
  5 files changed, 106 insertions(+)

diff --git a/block.c b/block.c
index 83f411f..8d63375 100644
--- a/block.c
+++ b/block.c
@@ -54,6 +54,7 @@
  struct BdrvDirtyBitmap {
      HBitmap *bitmap;
      char *name;
+    bool disabled;
      QLIST_ENTRY(BdrvDirtyBitmap) list;
  };
@@ -5412,10 +5413,16 @@ BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
      bitmap = g_new0(BdrvDirtyBitmap, 1);
      bitmap->bitmap = hbitmap_alloc(bitmap_size, ffs(sector_granularity) - 1);
      bitmap->name = g_strdup(name);
+    bitmap->disabled = false;

Unnecessary thanks to the g_new0(), but won't hurt.

Reviewed-by: Max Reitz <address@hidden>



reply via email to

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