From: Laszlo Ersek <lersek@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, rjones@redhat.com,
"Andreas Färber" <afaerber@suse.de>,
armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
Date: Thu, 23 Mar 2017 19:12:41 +0100 [thread overview]
Message-ID: <8de91ee6-958f-e0ba-bdba-2b37f4fa7b3f@redhat.com> (raw)
In-Reply-To: <20170323160315.19696-1-eblake@redhat.com>
On 03/23/17 17:03, Eric Blake wrote:
> Commit 9a6d1ac assumed that 'qom-type' could be removed from QemuOpts
> with no ill effects. However, this command line proves otherwise:
>
> $ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio \
> -object rng-random,filename=/dev/urandom,id=rng0 \
> -device virtio-rng-pci,rng=rng0
> qemu-system-x86_64: -object rng-random,filename=/dev/urandom,id=rng0: Parameter 'qom-type' is missing
>
> Fix the regression by restoring qom-type in opts after its temporary
> removal that was needed for the duration of user_creatable_add_opts().
>
> Reported-by: Richard W. M. Jones <rjones@redhat.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> qom/object_interfaces.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
> index 9c271ad..d4253a8 100644
> --- a/qom/object_interfaces.c
> +++ b/qom/object_interfaces.c
> @@ -122,6 +122,7 @@ Object *user_creatable_add_opts(QemuOpts *opts, Error **errp)
> }
> if (!id) {
> error_setg(errp, QERR_MISSING_PARAMETER, "id");
> + qemu_opt_set(opts, "qom-type", type, &error_abort);
> g_free(type);
> return NULL;
> }
> @@ -134,6 +135,7 @@ Object *user_creatable_add_opts(QemuOpts *opts, Error **errp)
> visit_free(v);
>
> qemu_opts_set_id(opts, (char *) id);
> + qemu_opt_set(opts, "qom-type", type, &error_abort);
> g_free(type);
> QDECREF(pdict);
> return obj;
>
Tested-by: Laszlo Ersek <lersek@redhat.com>
prev parent reply other threads:[~2017-03-23 18:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 16:03 [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type' Eric Blake
2017-03-23 16:23 ` Richard W.M. Jones
2017-03-23 16:24 ` Markus Armbruster
2017-03-23 18:49 ` Peter Maydell
2017-03-23 18:12 ` Laszlo Ersek [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=8de91ee6-958f-e0ba-bdba-2b37f4fa7b3f@redhat.com \
--to=lersek@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=rjones@redhat.com \
/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.