qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 03/11] snapshot: create bdrv_all_delete_snapshot


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 03/11] snapshot: create bdrv_all_delete_snapshot helper
Date: Fri, 6 Nov 2015 17:12:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/06/2015 05:09 PM, Stefan Hajnoczi wrote:
On Wed, Nov 04, 2015 at 08:19:34PM +0300, Denis V. Lunev wrote:
to delete snapshots from all loaded block drivers.

The patch also ensures proper locking.

Signed-off-by: Denis V. Lunev <address@hidden>
CC: Juan Quintela <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
CC: Kevin Wolf <address@hidden>
---
  block/snapshot.c         | 22 ++++++++++++++++++++
  include/block/snapshot.h |  2 ++
  migration/savevm.c       | 54 +++++++++---------------------------------------
  3 files changed, 34 insertions(+), 44 deletions(-)

diff --git a/block/snapshot.c b/block/snapshot.c
index d729c76..1b4b846 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -384,3 +384,25 @@ bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs)
      *first_bad_bs = bs;
      return ok;
  }
+
+int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,
+                             Error **err)
+{
+    int ret = 0;
+    BlockDriverState *bs = NULL;
+    QEMUSnapshotInfo sn1, *snapshot = &sn1;
+
+    while ((bs = bdrv_next(bs)) && ret == 0) {
If ret != 0 we will iterate to the next bs.  first_bad_bs will be
incorrect.
good catch! this applies as well to all patches below.
You don't need to point this again :)



reply via email to

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