From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlj0d-0004Sf-TH for qemu-devel@nongnu.org; Tue, 04 Nov 2014 13:39:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xlj0W-0000Kg-Et for qemu-devel@nongnu.org; Tue, 04 Nov 2014 13:39:15 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55207 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlj0W-0000KU-7o for qemu-devel@nongnu.org; Tue, 04 Nov 2014 13:39:08 -0500 Message-ID: <54591D4A.60302@suse.de> Date: Tue, 04 Nov 2014 19:39:06 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1415084147-11895-1-git-send-email-junmuzi@gmail.com> In-Reply-To: <1415084147-11895-1-git-send-email-junmuzi@gmail.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] qdev: modify func qdev_build_hotpluggable_device_list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Li , qemu-devel@nongnu.org Cc: peter.crosthwaite@xilinx.com, famz@redhat.com, mst@redhat.com, juli@redhat.com, imammedo@redhat.com, pbonzini@redhat.com Hi, Am 04.11.2014 um 07:55 schrieb Jun Li: > Currently when *obj is not a TYPE_DEVICE, qemu will abort. This patch j= ust > fixed it. When *obj is not a TYPE_DEVICE, just do not add it to hotplug= gable > device list. >=20 > 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=3Dscsi0 >=20 > 2, device_del scsi0 via hmp using tab key(first input device_del, then = press > "Tab" key). > (qemu) device_del >=20 > After step2, qemu will abort. > (qemu) device_del hw/core/qdev.c:930:qdev_build_hotpluggable_device_lis= t: > Object 0x5555563a2460 is not an instance of type device >=20 > Signed-off-by: Jun Li > Reviewed-by: Paolo Bonzini > --- > 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=3Dscsi0 -enable-kvm >=20 > 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=3Dscsi0 > --- > 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 =3D=3D NULL) { return 0; } What do you think? Regards, Andreas --=20 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 21284 AG N=FCrnbe= rg