[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qdev: modify func qdev_build_hotpluggable_de
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH v2] qdev: modify func qdev_build_hotpluggable_device_list |
Date: |
Tue, 04 Nov 2014 19:39:06 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
Hi,
Am 04.11.2014 um 07:55 schrieb Jun Li:
> Currently when *obj is not a TYPE_DEVICE, qemu will abort. This patch just
> fixed it. When *obj is not a TYPE_DEVICE, just do not add it to hotpluggable
> device list.
>
> This patch also fixed 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 step2, 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 <address@hidden>
> Reviewed-by: Paolo Bonzini <address@hidden>
> ---
> v2:
> This version just do a little changes for the commit message.
> As following show:
> In v1,
> 1, boot qemu using cli:
> virtio-scsi-pci,id=scsi0 -enable-kvm
>
> In v2,
> 1, boot qemu using cli:
> $ /opt/qemu-git-arm/bin/qemu-system-x86_64 -monitor stdio -enable-kvm \
> -device virtio-scsi-pci,id=scsi0
> ---
> hw/core/qdev.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
Thanks, I've queued this patch, but we should give it a more meaningful
subject - maybe "qdev: Avoid type assertion in qdev_build_...()"?
Also, we could avoid reindentation by returning early:
if (dev == NULL) {
return 0;
}
What do you think?
Regards,
Andreas
--
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 21284 AG Nürnberg