From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsIGH-0001eX-GQ for qemu-devel@nongnu.org; Sun, 15 Dec 2013 15:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsIGA-0005zu-5e for qemu-devel@nongnu.org; Sun, 15 Dec 2013 15:26:01 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53617 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsIG9-0005zq-VO for qemu-devel@nongnu.org; Sun, 15 Dec 2013 15:25:54 -0500 Message-ID: <52AE104C.9090703@suse.de> Date: Sun, 15 Dec 2013 21:25:48 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1385656023-11519-1-git-send-email-armbru@redhat.com> <1385656023-11519-11-git-send-email-armbru@redhat.com> In-Reply-To: <1385656023-11519-11-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 10/10] qdev: Do not let the user try to device_add when it cannot work List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: armbru@redhat.com, qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, borntraeger@de.ibm.com, Luiz Capitulino , aliguori@amazon.com, marcel.a@redhat.com Am 28.11.2013 17:27, schrieb armbru@redhat.com: > From: Markus Armbruster >=20 > Such devices have always been unavailable and omitted from the list of > available devices shown by device_add help. Until commit 18b6dad > silently broke the former, setting up nasty traps for unwary users, > like this one: >=20 > $ qemu-system-x86_64 -nodefaults -monitor stdio -display none > QEMU 1.6.50 monitor - type 'help' for more information > (qemu) device_add apic > Segmentation fault (core dumped) >=20 > I call that a regression. Fix it. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Marcel Apfelbaum > --- > qdev-monitor.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/qdev-monitor.c b/qdev-monitor.c > index e6825ba..177b849 100644 > --- a/qdev-monitor.c > +++ b/qdev-monitor.c > @@ -490,6 +490,11 @@ DeviceState *qdev_device_add(QemuOpts *opts) > } > =20 > dc =3D DEVICE_CLASS(oc); > + if (dc->cannot_instantiate_with_device_add_yet) { > + qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", > + "pluggable device type"); Is this a restoration of a previous state? Because I thought we shouldn't use QERR_* any more for new code... Andreas > + return NULL; > + } > =20 > /* find bus */ > path =3D qemu_opt_get(opts, "bus"); >=20 --=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