From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
qemu-stable@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH 35/40] Revert "qdev: Use qdev_get_device_class() for -device <type>, help"
Date: Wed, 21 Oct 2015 12:52:05 -0500 [thread overview]
Message-ID: <1445449930-23525-36-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1445449930-23525-1-git-send-email-mdroth@linux.vnet.ibm.com>
From: Markus Armbruster <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>
Message-Id: <1443689999-12182-11-git-send-email-armbru@redhat.com>
(cherry picked from commit 33fe96833015cf15f4c0aa5bf8d34f60526e0732)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qdev-monitor.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index f9e2d62..0e14747 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);
--
1.9.1
next prev parent reply other threads:[~2015-10-21 17:55 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 17:51 [Qemu-devel] [PATCH 00/40] Patch Round-up for stable 2.4.1, freeze on 2015-10-29 Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 01/40] scsi-disk: Fix assertion failure on WRITE SAME Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 02/40] mirror: Fix coroutine reentrance Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 03/40] target-arm/arm-semi.c: Fix broken SYS_WRITE0 via gdb Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 04/40] block/iscsi: validate block size returned from target Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 05/40] exec-all: Translate TCI return addresses backwards too Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 06/40] block/nfs: fix calculation of allocated file size Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 07/40] qemu-img: Fix crash in amend invocation Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 08/40] mac_dbdma: always clear FLUSH bit once DBDMA channel flush is complete Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 09/40] vhost-scsi: fix wrong vhost-scsi firmware path Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 10/40] scripts/dump-guest-memory.py: fix after RAMBlock change Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 11/40] PPC: E500: Update u-boot to commit 79c884d7e4 Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 12/40] s390x/css: start with cleared cstat/dstat Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 13/40] rtl8139: Fix receive buffer overflow check Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 14/40] rtl8139: Do not consume the packet during overflow in standard mode Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 15/40] cpus.c: qemu_mutex_lock_iothread fix race condition at cpu thread init Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 16/40] virtio dataplane: adapt dataplane for virtio Version 1 Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 17/40] target-arm: Share all common TCG temporaries Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 18/40] qcow2: Make size_to_clusters() return uint64_t Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 19/40] ide: fix ATAPI command permissions Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 20/40] gtk: use setlocale() for LC_MESSAGES only Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 21/40] spapr_pci: fix device tree props for MSI/MSI-X Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 22/40] nbd: release exp->blk after all clients are closed Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 23/40] slirp: Fix non blocking connect for w32 Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 24/40] ide: unify io_buffer_offset increments Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 25/40] qom: Do not reuse errp after a possible error Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 26/40] qom: Fix invalid error check in property_get_str() Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 27/40] tcg/mips: Fix clobbering of qemu_ld inputs Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 28/40] target-ppc: fix vcipher, vcipherlast, vncipherlast and vpermxor Michael Roth
2015-10-21 17:51 ` [Qemu-devel] [PATCH 29/40] target-ppc: fix xscmpodp and xscmpudp decoding Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 30/40] virtio: avoid leading underscores for helpers Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 31/40] virtio-net: unbreak self announcement and guest offloads after migration Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 32/40] vmxnet3: Drop net_vmxnet3_info.can_receive Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 33/40] qmp: Fix device-list-properties not to crash for abstract device Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 34/40] qdev: Protect device-list-properties against broken devices Michael Roth
2015-10-21 17:52 ` Michael Roth [this message]
2015-10-21 17:52 ` [Qemu-devel] [PATCH 36/40] misc: zynq_slcr: Fix MMIO writes Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 37/40] s390x/kvm: Fix vector validity bit in device machine checks Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 38/40] util/qemu-config: fix missing machine command line options Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 39/40] Migration: Generate the completed event only when we complete Michael Roth
2015-10-21 17:52 ` [Qemu-devel] [PATCH 40/40] virtio-input: ignore events until the guest driver is ready Michael Roth
2015-10-21 18:05 ` [Qemu-devel] [PATCH 00/40] Patch Round-up for stable 2.4.1, freeze on 2015-10-29 Cole Robinson
2015-10-21 18:43 ` Michael Roth
2015-10-22 17:36 ` Cole Robinson
2015-10-22 8:01 ` Markus Armbruster
2015-10-29 19:19 ` Michael Roth
2015-10-29 20:53 ` Denis V. Lunev
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=1445449930-23525-36-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).