From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.7] block/qdev: Let 'drive' property fall back to node name
Date: Thu, 4 Aug 2016 14:11:11 +0200 [thread overview]
Message-ID: <20160804121111.GA4938@noname.redhat.com> (raw)
In-Reply-To: <1470312212-3005-1-git-send-email-kwolf@redhat.com>
Am 04.08.2016 um 14:03 hat Kevin Wolf geschrieben:
> If a qdev block device is created with an anonymous BlockBackend (i.e.
> a node name rather than a BB name was given for the drive property),
> qdev used to return an empty string when the property was read. This
> patch fixes it to return the node name instead.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
As always, the moment you send out a patch, you notice that it's
broken.
> diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
> index 2ba2504..25b24aa 100644
> --- a/hw/core/qdev-properties-system.c
> +++ b/hw/core/qdev-properties-system.c
> @@ -126,7 +126,13 @@ static void release_drive(Object *obj, const char *name, void *opaque)
>
> static char *print_drive(void *ptr)
> {
> - return g_strdup(blk_name(ptr));
> + const char *name;
> +
> + name = blk_name(ptr);
> + if (!*name) {
> + name = bdrv_get_node_name(blk_bs(ptr));
blk_bs(ptr) can be NULL. Self-NACK, v2 is coming.
> + }
> + return g_strdup(name);
> }
Kevin
prev parent reply other threads:[~2016-08-04 12:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 12:03 [Qemu-devel] [PATCH for-2.7] block/qdev: Let 'drive' property fall back to node name Kevin Wolf
2016-08-04 12:11 ` Kevin Wolf [this message]
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=20160804121111.GA4938@noname.redhat.com \
--to=kwolf@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).