qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V7 06/14] block: add image info query function b


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V7 06/14] block: add image info query function bdrv_query_image_info()
Date: Fri, 01 Mar 2013 09:44:18 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

于 2013-2-28 23:47, Stefan Hajnoczi 写道:
On Tue, Feb 26, 2013 at 06:40:20PM +0800, Wenchao Xia wrote:
diff --git a/block.c b/block.c
index 8d0145a..71fc9e7 100644
--- a/block.c
+++ b/block.c
@@ -2880,15 +2880,33 @@ SnapshotInfoList 
*bdrv_query_snapshot_infolist(BlockDriverState *bs,
      return head;
  }

-void collect_image_info(BlockDriverState *bs,
-                        ImageInfo *info,
-                        const char *filename)
+/* collect all internal snapshot info in a image for ImageInfo */
+static void collect_snapshots_info(BlockDriverState *bs,
+                                   ImageInfo *info,
+                                   Error **errp)
+{
+    SnapshotInfoList *info_list;
+
+    if (!bdrv_can_read_snapshot(bs)) {
+        return;
+    }
+    info_list = bdrv_query_snapshot_infolist(bs, NULL, NULL, errp);
+    if (info_list != NULL) {
+        info->has_snapshots = true;
+        info->snapshots = info_list;
+    }
+}

This is a pretty trivial function that is used only once.  Inlining the
code is clearer IMO.

OK.

--
Best Regards

Wenchao Xia




reply via email to

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