qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V4 04/13] block: add snapshot info query functio


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V4 04/13] block: add snapshot info query function bdrv_query_snapshot_infolist()
Date: Fri, 18 Jan 2013 09:57:33 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

于 2013-1-18 5:53, Eric Blake 写道:
On 01/17/2013 12:40 AM, Wenchao Xia wrote:
   This patch add function bdrv_query_snapshot_infolist(), which will
return snapshot info of an image in qmp object format. The implementation
code are mostly copied from qemu-img.c with modification to fit more
for qmp based block layer API.
   To help filter out snapshot info not needed, a call back function is
added in bdrv_query_snapshot_infolist().
   bdrv_can_read_snapshot() should be called before call this function,
to avoid got *errp set unexpectly.

s/unexpectly/unexpectedly/

 sorry for it.


Signed-off-by: Wenchao Xia <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
  block.c               |   46 ++++++++++++++++++++++++++++++++++++++++++++++
  include/block/block.h |    7 +++++++
  2 files changed, 53 insertions(+), 0 deletions(-)


+SnapshotInfoList *bdrv_query_snapshot_infolist(BlockDriverState *bs,
+                                               SnapshotFilterFunc filter,
+                                               void *opaque,
+                                               Error **errp)
+{
+    int i, sn_count;
+    QEMUSnapshotInfo *sn_tab = NULL;
+    SnapshotInfoList *info_list, *cur_item = NULL, *head = NULL;
+
+    sn_count = bdrv_snapshot_list(bs, &sn_tab);
+    if (sn_count < 0) {
+        /* Fix me:  set errp in bdrv_snapshot_list() instead of here */

You didn't remove this fixme anywhere in the series; it would be better
to respin things to avoid a net gain of fixmes.

  yep, but solving that may need more work focusing on the function
enhancement and caller behavior which already exist, not quite related
to this serial. This serial is a bit long already, I'd like a
standalone patch for it later.

+        error_setg(errp, "bdrv_snapshot_list: error %d\n", sn_count);
+        return NULL;
+    }



--
Best Regards

Wenchao Xia




reply via email to

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