summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-03-23 11:03:15 -0500
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-03-30 12:52:04 -0500
commit07672ab0031ace234a4031e439e7174cde1e1d72 (patch)
treedb182e31af6e8f6e4a38d7b1aa7fdc85099d2380
parent877e2b016ebc4686322e5f08186eb25ed42a52a3 (diff)
downloadqemu-07672ab0031ace234a4031e439e7174cde1e1d72.tar.gz
qom: Fix regression with 'qom-type'
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> Reviewed-by: Markus Armbruster <armbru@redhat.com> Tested-by: Richard W.M. Jones <rjones@redhat.com> Message-id: 20170323160315.19696-1-eblake@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org> (cherry picked from commit 08329701199449bde497570dcfdb9c86062baf20) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--qom/object_interfaces.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 0283de8349..fd7061c4f3 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -117,6 +117,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;
}
@@ -129,6 +130,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;