]> Git Repo - qemu.git/commitdiff
block/qapi: Use blk_all_next() for query-block
authorKevin Wolf <[email protected]>
Tue, 11 Jul 2017 11:04:28 +0000 (13:04 +0200)
committerKevin Wolf <[email protected]>
Tue, 18 Jul 2017 13:14:36 +0000 (15:14 +0200)
This patch replaces the blk_next() loop in query-block by a
blk_all_next() one so that we also get access to BlockBackends that
aren't owned by the monitor. For now, the next thing we do is check
whether each BB has a name, so there is no semantic difference.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: John Snow <[email protected]>
block/qapi.c

index c8a45ec54c6ca5b8e20bcb001ec6ef4d801a4b26..164dd2b9a9b1f035d5fcf1b0773b54a3987d0134 100644 (file)
@@ -472,8 +472,14 @@ BlockInfoList *qmp_query_block(Error **errp)
     BlockBackend *blk;
     Error *local_err = NULL;
 
-    for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
-        BlockInfoList *info = g_malloc0(sizeof(*info));
+    for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) {
+        BlockInfoList *info;
+
+        if (!*blk_name(blk)) {
+            continue;
+        }
+
+        info = g_malloc0(sizeof(*info));
         bdrv_query_info(blk, &info->value, &local_err);
         if (local_err) {
             error_propagate(errp, local_err);
This page took 0.025906 seconds and 4 git commands to generate.