From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdgZi-0005mL-Tz for qemu-devel@nongnu.org; Wed, 28 Nov 2012 07:17:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdgZd-0006de-54 for qemu-devel@nongnu.org; Wed, 28 Nov 2012 07:17:10 -0500 Received: from mx3-phx2.redhat.com ([209.132.183.24]:58963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdgZc-0006dY-Sv for qemu-devel@nongnu.org; Wed, 28 Nov 2012 07:17:05 -0500 Date: Wed, 28 Nov 2012 07:17:04 -0500 (EST) From: Alon Levy Message-ID: <180426937.39000613.1354105024440.JavaMail.root@redhat.com> In-Reply-To: <20121128095456.1d032f4b@doriath.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/qdev-monitor: report error for -device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de, armbru@redhat.com > On Wed, 28 Nov 2012 10:54:33 +0200 > Alon Levy wrote: > > > Instead of aborting immediately after at DEVICE_CLASS(obj) > > > > Signed-off-by: Alon Levy > > --- > > hw/qdev-monitor.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c > > index 479eecd..3b70cdb 100644 > > --- a/hw/qdev-monitor.c > > +++ b/hw/qdev-monitor.c > > @@ -426,6 +426,11 @@ DeviceState *qdev_device_add(QemuOpts *opts) > > return NULL; > > } > > > > + if (!object_class_dynamic_cast(obj, "device")) { > > + qerror_report(QERR_INVALID_PARAMETER_TYPE, "driver", > > "device type"); > > + return NULL; > > + } > > Gives me the impression that something is wrong before this, but it's > better to ask a QOM guy (CC'ing them). > > How do you reproduce it btw? -device virtio-serial-bus which is the incorrect way of saying -device virtio-serial-pci > > > + > > k = DEVICE_CLASS(obj); > > > > /* find bus */ > >