All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, eblake@redhat.com,
	jsnow@redhat.com, pbonzini@redhat.com, armbru@redhat.com,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/9] block/qapi: Use blk_all_next() for query-block
Date: Wed, 12 Jul 2017 14:57:24 +0200	[thread overview]
Message-ID: <1499864249-26305-5-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1499864249-26305-1-git-send-email-kwolf@redhat.com>

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 semantical difference.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qapi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/block/qapi.c b/block/qapi.c
index 705cd11..2f86c79 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -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);
-- 
1.8.3.1

  parent reply	other threads:[~2017-07-12 12:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 12:57 [Qemu-devel] [PATCH 0/9] block: -device drive=<node-name> fixes Kevin Wolf
2017-07-12 12:57 ` [Qemu-devel] [PATCH 1/9] block: Make blk_get_attached_dev_id() public Kevin Wolf
2017-07-12 14:53   ` Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 2/9] block/qapi: Add qdev device name to query-block Kevin Wolf
2017-07-12 15:06   ` Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 3/9] block: Make blk_all_next() public Kevin Wolf
2017-07-12 15:25   ` Eric Blake
2017-07-12 12:57 ` Kevin Wolf [this message]
2017-07-12 15:27   ` [Qemu-devel] [PATCH 4/9] block/qapi: Use blk_all_next() for query-block Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 5/9] block: List anonymous device BBs in query-block Kevin Wolf
2017-07-12 15:47   ` Eric Blake
2017-07-13 11:25     ` Kevin Wolf
2017-07-12 12:57 ` [Qemu-devel] [PATCH 6/9] ide: bdrv_attach_dev() for empty CD-ROM Kevin Wolf
2017-07-12 15:52   ` Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 7/9] scsi-disk: " Kevin Wolf
2017-07-12 15:58   ` Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 8/9] qemu-iotests: Test 'info block' Kevin Wolf
2017-07-12 16:22   ` Eric Blake
2017-07-12 12:57 ` [Qemu-devel] [PATCH 9/9] qemu-iotests: Test unplug of -device without drive Kevin Wolf
2017-07-12 16:23   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499864249-26305-5-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.