diff options
author | Jun Li <junmuzi@gmail.com> | 2014-11-05 15:03:03 +0800 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-02-16 15:05:42 +0100 |
commit | 09d560177101d2ef1e333754a25cfa49b70583b3 (patch) | |
tree | c916151a7fdcf4cb90d2c2949cea9a232e726a0b /include/qom/object.h | |
parent | cd2d5541271f1934345d8ca42f5fafff1744eee7 (diff) |
qdev: Avoid type assertion in qdev_build_hotpluggable_device_list()
Currently when *obj is not a TYPE_DEVICE, QEMU will abort. This patch
fixes it. When *obj is not a TYPE_DEVICE, just do not add it to hotpluggable
device list.
This patch also fixes the following issue:
1. boot QEMU using cli:
$ /opt/qemu-git-arm/bin/qemu-system-x86_64 -monitor stdio -enable-kvm \
-device virtio-scsi-pci,id=scsi0
2. device_del scsi0 via hmp using tab key(first input device_del, then press
"Tab" key).
(qemu) device_del
After step 2, QEMU will abort.
(qemu) device_del hw/core/qdev.c:930:qdev_build_hotpluggable_device_list:
Object 0x5555563a2460 is not an instance of type device
Signed-off-by: Jun Li <junmuzi@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/qom/object.h')
0 files changed, 0 insertions, 0 deletions