From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XluOD-00085p-Fj for qemu-devel@nongnu.org; Wed, 05 Nov 2014 01:48:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XluO4-0001kd-9O for qemu-devel@nongnu.org; Wed, 05 Nov 2014 01:48:21 -0500 Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]:58897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XluO4-0001kR-1W for qemu-devel@nongnu.org; Wed, 05 Nov 2014 01:48:12 -0500 Received: by mail-pd0-f170.google.com with SMTP id z10so158373pdj.29 for ; Tue, 04 Nov 2014 22:48:10 -0800 (PST) Date: Wed, 5 Nov 2014 14:48:05 +0800 From: Jun Li Message-ID: <20141105064804.GA6131@localhost.localdomain> References: <1415084147-11895-1-git-send-email-junmuzi@gmail.com> <54591D4A.60302@suse.de> <20141105015949.GC2712@fam-t430.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141105015949.GC2712@fam-t430.nay.redhat.com> 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: Fam Zheng Cc: peter.crosthwaite@xilinx.com, mst@redhat.com, qemu-devel@nongnu.org, imammedo@redhat.com, pbonzini@redhat.com, Andreas =?iso-8859-1?Q?F=E4rber?= On Wed, 11/05 09:59, Fam Zheng wrote: > On Wed, 11/05 08:53, jun muzi wrote: > > Yes, in my original thought i just want to do as you said. But it will have > > two "return 0" in one function. So i think it's not so smart. If you still > > think two "return 0" is better, i will submit a new version. Thanks. > > > > BTW, for subject, i agree with you. > > Please use inline reply for mailing list discussions. Ok, got it. Thx. > > Fam > > > > > Jun Li > > 2014-11-5 上午2:39于 "Andreas Färber" 写道: > > > > > 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 > > > > 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=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 > > >