From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: thuth@redhat.com, ehabkost@redhat.com, qemu-stable@nongnu.org,
stefanha@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH v4 7/7] Revert "qdev: Use qdev_get_device_class() for -device <type>, help"
Date: Mon, 28 Sep 2015 22:08:27 +0200 [thread overview]
Message-ID: <1443470907-32335-8-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1443470907-32335-1-git-send-email-armbru@redhat.com>
This reverts commit 31bed5509dfcbdfc293154ce81086a4dbd7a80b6.
The reverted commit changed qdev_device_help() to reject abstract
devices and devices that have cannot_instantiate_with_device_add_yet
set, to fix crash bugs like -device x86_64-cpu,help.
Rejecting abstract devices makes sense: they're purely internal, and
the implementation of the help feature can't cope with them.
Rejecting non-pluggable devices makes less sense: even though you
can't use them with -device, the help may still be useful elsewhere,
for instance with -global. This is a regression: -device FOO,help
used to help even for FOO that aren't pluggable.
The previous two commits fixed the crash bug at a lower layer, so
reverting this one is now safe. Fixes the -device FOO,help
regression, except for the broken devices marked
cannot_even_create_with_object_new_yet. For those, the error message
is improved.
Example of a device where the regression is fixed:
$ qemu-system-x86_64 -device PIIX4_PM,help
PIIX4_PM.command_serr_enable=bool (on/off)
PIIX4_PM.multifunction=bool (on/off)
PIIX4_PM.rombar=uint32
PIIX4_PM.romfile=str
PIIX4_PM.addr=int32 (Slot and optional function number, example: 06.0 or 06)
PIIX4_PM.memory-hotplug-support=bool
PIIX4_PM.acpi-pci-hotplug-with-bridge-support=bool
PIIX4_PM.s4_val=uint8
PIIX4_PM.disable_s4=uint8
PIIX4_PM.disable_s3=uint8
PIIX4_PM.smb_io_base=uint32
Example of a device where it isn't fixed:
$ qemu-system-x86_64 -device host-x86_64-cpu,help
Can't list properties of device 'host-x86_64-cpu'
Both failed with "Parameter 'driver' expects pluggable device type"
before.
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
qdev-monitor.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index eb7aef2..1cadefb 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -237,9 +237,12 @@ int qdev_device_help(QemuOpts *opts)
return 0;
}
- qdev_get_device_class(&driver, &local_err);
- if (local_err) {
- goto error;
+ if (!object_class_by_name(driver)) {
+ const char *typename = find_typename_by_alias(driver);
+
+ if (typename) {
+ driver = typename;
+ }
}
prop_list = qmp_device_list_properties(driver, &local_err);
--
2.4.3
next prev parent reply other threads:[~2015-09-28 20:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 20:08 [Qemu-devel] [PATCH v4 0/7] Fix device introspection regressions Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 1/7] tests: Fix how qom-test is run Markus Armbruster
2015-09-29 16:06 ` Andreas Färber
2015-10-01 5:41 ` Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 2/7] libqtest: Clean up unused QTestState member sigact_old Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 3/7] libqtest: New hmp() & friends Markus Armbruster
2015-09-29 6:38 ` Thomas Huth
2015-09-29 12:41 ` Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 4/7] device-introspect-test: New, covering device introspection Markus Armbruster
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 5/7] qmp: Fix device-list-properties not to crash for abstract device Markus Armbruster
2015-09-29 6:50 ` Thomas Huth
2015-09-29 12:44 ` Markus Armbruster
2015-09-29 16:07 ` Andreas Färber
2015-09-28 20:08 ` [Qemu-devel] [PATCH v4 6/7] qdev: Protect device-list-properties against broken devices Markus Armbruster
2015-09-28 20:15 ` Eduardo Habkost
2015-09-29 7:01 ` Thomas Huth
2015-09-29 16:22 ` Andreas Färber
2015-10-01 5:45 ` Markus Armbruster
2015-09-28 20:08 ` Markus Armbruster [this message]
2015-09-29 15:33 ` [Qemu-devel] [PATCH v4 0/7] Fix device introspection regressions Markus Armbruster
2015-10-01 13:42 ` Stefan Hajnoczi
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=1443470907-32335-8-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@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 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).