qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/6] snapshot: export function in block.c


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH 1/6] snapshot: export function in block.c
Date: Tue, 08 Jan 2013 10:25:22 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0

于 2013-1-8 0:43, Kevin Wolf 写道:
Am 17.12.2012 07:25, schrieb Wenchao Xia:
   This patch moves bdrv_snapshotfind from savevm.c to block.c and export
it, also added bdrv_deappend in block.c.

Signed-off-by: Wenchao Xia <address@hidden>

Should be two separate patches.

  OK, it have been split into two patches in V2.

---
  block.c  |   30 ++++++++++++++++++++++++++++++
  block.h  |    3 +++
  savevm.c |   22 ----------------------
  3 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/block.c b/block.c
index 0668c4b..61c7c6a 100644
--- a/block.c
+++ b/block.c
@@ -1376,6 +1376,13 @@ void bdrv_append(BlockDriverState *bs_new, 
BlockDriverState *bs_top)
              bs_new->drv ? bs_new->drv->format_name : "");
  }

+/* revert the action */
+void bdrv_deappend(BlockDriverState *bs_new, BlockDriverState *bs_top)
+{
+    bdrv_swap(bs_new, bs_top);
+    /* this is enough? */
+}

What will this be used for? Maybe it's better to introduce a function
simple as this only when it's actually used.

  If bdrv_append is called before, this function should revert it, so
new file created at the top of the backing file chain is dropped.

Kevin



--
Best Regards

Wenchao Xia




reply via email to

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