]> Git Repo - qemu.git/blobdiff - qemu-img.c
qmp: add ImageInfo in BlockDeviceInfo used by query-block
[qemu.git] / qemu-img.c
index e089c7860b791e0d67bb8ac81f991a1a897a6e8c..809b4f1c00ae05dc1248c15848b2a2b0050b48da 100644 (file)
@@ -1644,6 +1644,7 @@ static ImageInfoList *collect_image_info_list(const char *filename,
     ImageInfoList *head = NULL;
     ImageInfoList **last = &head;
     GHashTable *filenames;
+    Error *err = NULL;
 
     filenames = g_hash_table_new_full(g_str_hash, str_equal_func, NULL, NULL);
 
@@ -1665,9 +1666,12 @@ static ImageInfoList *collect_image_info_list(const char *filename,
             goto err;
         }
 
-        info = g_new0(ImageInfo, 1);
-        bdrv_collect_image_info(bs, info, filename);
-        bdrv_collect_snapshots(bs, info);
+        bdrv_query_image_info(bs, &info, &err);
+        if (error_is_set(&err)) {
+            error_report("%s", error_get_pretty(err));
+            error_free(err);
+            goto err;
+        }
 
         elem = g_new0(ImageInfoList, 1);
         elem->value = info;
This page took 0.023541 seconds and 4 git commands to generate.