From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xkbj6-0006wn-2c for qemu-devel@nongnu.org; Sat, 01 Nov 2014 12:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xkbiy-0001MI-Im for qemu-devel@nongnu.org; Sat, 01 Nov 2014 12:40:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50795 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xkbiy-0001M2-C6 for qemu-devel@nongnu.org; Sat, 01 Nov 2014 12:40:24 -0400 Message-ID: <54550CF4.3050200@suse.de> Date: Sat, 01 Nov 2014 17:40:20 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1414857371-12294-1-git-send-email-ehabkost@redhat.com> <1414857371-12294-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1414857371-12294-4-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] qdev: Use qdev_device_add_get_class() for -device , help List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Igor Mammedov , Gonglei , Stefan Hajnoczi , Paolo Bonzini Hi Eduardo, Am 01.11.2014 um 16:56 schrieb Eduardo Habkost: > Make sure we try to list properties from classes that can be safely use= d with > "-device". >=20 > Fixes the following crashes: >=20 > $ qemu-system-x86_64 -device x86_64-cpu,help > ** > ERROR:qom/object.c:336:object_initialize_with_type: assertion failed:= (type->abstract =3D=3D false) > Aborted (core dumped) > $ qemu-system-x86_64 -device host-x86_64-cpu,help > qemu-system-x86_64: [...]/target-i386/cpu.c:1329: host_x86_cpu_initfn= : Assertion `(kvm_allowed)' failed. > Aborted (core dumped) >=20 > After applying this patch: >=20 > $ qemu-system-x86_64 -device x86_64-cpu,help > Parameter 'driver' expects non-abstract device type > $ qemu-system-x86_64 -device host-x86_64-cpu,help > Parameter 'driver' expects pluggable device type >=20 > Signed-off-by: Eduardo Habkost > --- > qdev-monitor.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) >=20 > diff --git a/qdev-monitor.c b/qdev-monitor.c > index a9702d8..ebfa701 100644 > --- a/qdev-monitor.c > +++ b/qdev-monitor.c > @@ -235,12 +235,9 @@ int qdev_device_help(QemuOpts *opts) > return 0; > } > =20 > - if (!object_class_by_name(driver)) { > - const char *typename =3D find_typename_by_alias(driver); > - > - if (typename) { > - driver =3D typename; > - } > + qdev_get_device_class(&driver, &local_err); > + if (local_err) { > + goto error; > } > =20 > prop_list =3D qmp_device_list_properties(driver, &local_err); Is dc->cannot_instantiate_with_device_add_yet || (qdev_hotplug && !dc->hotpluggable) really relevant here? Or should that rather remain outside the common function in 1/3? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg