[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/12] qdev: Fix crash when using non-device class na
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 10/12] qdev: Fix crash when using non-device class name on -global |
Date: |
Mon, 7 Jul 2014 15:40:39 +0300 |
From: Eduardo Habkost <address@hidden>
This fixes the following crash:
$ qemu-system-x86_64 -global container.xxx=y
hw/core/qdev-properties-system.c:399:qdev_add_one_global: Object
0x7f7eff234100 is not an instance of type device
Aborted (core dumped)
New behavior will be to just warn, just like when non-existing clas
names are used:
$ qemu-system-x86_64 -global container.xxx=y
qemu-system-x86_64: Warning: "-global container.xxx=y" not used
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Tested-by: Don Slutz <address@hidden>
---
hw/core/qdev-properties-system.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 8e140af..ae0900f 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -394,7 +394,8 @@ static int qdev_add_one_global(QemuOpts *opts, void *opaque)
g->driver = qemu_opt_get(opts, "driver");
g->property = qemu_opt_get(opts, "property");
g->value = qemu_opt_get(opts, "value");
- oc = object_class_by_name(g->driver);
+ oc = object_class_dynamic_cast(object_class_by_name(g->driver),
+ TYPE_DEVICE);
if (oc) {
DeviceClass *dc = DEVICE_CLASS(oc);
--
MST
- [Qemu-devel] [PULL 00/12] pc,vhost,virtio fixes, test, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 01/12] qtest: enable vhost-user-test, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 02/12] numa: check for busy memory backend, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 03/12] pc-dimm: error out if memory hotplug is not enabled, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 12/12] qemu-char: add chr_add_watch support in mux chardev, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 10/12] qdev: Fix crash when using non-device class name on -global,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 06/12] pci: assign devfn to pci_dev before calling pci_device_iommu_address_space(), Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 08/12] hw/virtio: enable common virtio feature for mmio device, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 07/12] acpi: fix typo in memory hotplug MMIO region name, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 05/12] Handle G_IO_HUP in tcp_chr_read for tcp chardev, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 11/12] virtio-pci: fix MSI memory region use after free, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 09/12] qdev: Don't abort() in case globals can't be set, Michael S. Tsirkin, 2014/07/07
- [Qemu-devel] [PULL 04/12] virtio: move common virtio properties to bus class device, Michael S. Tsirkin, 2014/07/07
- Re: [Qemu-devel] [PULL 00/12] pc,vhost,virtio fixes, test, Peter Maydell, 2014/07/07