* [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
@ 2017-03-23 16:03 Eric Blake
2017-03-23 16:23 ` Richard W.M. Jones
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Eric Blake @ 2017-03-23 16:03 UTC (permalink / raw)
To: qemu-devel; +Cc: rjones, armbru, qemu-stable, Andreas Färber
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;
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
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:12 ` Laszlo Ersek
2 siblings, 0 replies; 5+ messages in thread
From: Richard W.M. Jones @ 2017-03-23 16:23 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, qemu-stable, Andreas Färber, armbru
On Thu, Mar 23, 2017 at 11:03:15AM -0500, 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;
Thanks Eric. Yes, this fixes the problem I observed before
with libguestfs.
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
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
2 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2017-03-23 16:24 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, qemu-stable, rjones, Andreas Färber,
Peter Maydell
Eric Blake <eblake@redhat.com> writes:
> 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
Shows that our test coverage is still inadequate. Also shows that I
should do more manual testing myself. Sorry for the inconvenience!
> 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;
The awkwardness increases a bit more, but I don't have better ideas.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Peter, can you apply this as a build fix?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
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:12 ` Laszlo Ersek
2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2017-03-23 18:12 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: qemu-stable, rjones, Andreas Färber, armbru
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.9] qom: Fix regression with 'qom-type'
2017-03-23 16:24 ` Markus Armbruster
@ 2017-03-23 18:49 ` Peter Maydell
0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2017-03-23 18:49 UTC (permalink / raw)
To: Markus Armbruster
Cc: Eric Blake, QEMU Developers, qemu-stable, Richard W.M. Jones,
Andreas Färber
On 23 March 2017 at 16:24, Markus Armbruster <armbru@redhat.com> wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> 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
>
> Shows that our test coverage is still inadequate. Also shows that I
> should do more manual testing myself. Sorry for the inconvenience!
>
>> 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;
>
> The awkwardness increases a bit more, but I don't have better ideas.
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
> Peter, can you apply this as a build fix?
Sure; applied to master.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-23 18:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.