aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-06-06 12:27:57 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-06-07 13:37:45 +0200
commitfb0ed4539c6f02fa9e5a3cf9df2549713451eeca (patch)
tree208ab0793bd0c675d8b9a88869f053352d99b586 /qemu-img.c
parentbd07684aacfb61668ae2c25b7dd00b64f3d7c7f3 (diff)
block: add snapshot info query function bdrv_query_snapshot_info_list()
This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code moved from qemu-img.c with modification to fit more for qmp based block layer API. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index e089c7860b..e3d8fe3c77 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1667,7 +1667,10 @@ static ImageInfoList *collect_image_info_list(const char *filename,
info = g_new0(ImageInfo, 1);
bdrv_collect_image_info(bs, info, filename);
- bdrv_collect_snapshots(bs, info);
+ bdrv_query_snapshot_info_list(bs, &info->snapshots, NULL);
+ if (info->snapshots) {
+ info->has_snapshots = true;
+ }
elem = g_new0(ImageInfoList, 1);
elem->value = info;