From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsDYw-00070f-8C for qemu-devel@nongnu.org; Mon, 07 Jan 2013 09:20:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsDYr-0001ns-HR for qemu-devel@nongnu.org; Mon, 07 Jan 2013 09:20:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:35839 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsDYr-0001no-Ax for qemu-devel@nongnu.org; Mon, 07 Jan 2013 09:20:21 -0500 Message-ID: <50EAD9A1.7090407@suse.de> Date: Mon, 07 Jan 2013 15:20:17 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1355760006-891-1-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1355760006-891-1-git-send-email-borntraeger@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qdev: obey no_user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Anthony Liguori , "qemu-devel@nongnu.org" , Luiz Capitulino Am 17.12.2012 17:00, schrieb Christian Borntraeger: > since >=20 > commit 18b6dade8c0799c48f5c5e124b8c407cd5e22e96 > qdev: refactor device creation to allow bus_info to be set only in clas= s >=20 > A user can specify a device that is no_user. > For example on my i386 box, I can add a 2nd kvmvapic device. >=20 > This patch checks for no-user and rejects the device_add. >=20 > Signed-off-by: Christian Borntraeger > --- > hw/qdev-monitor.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c > index a1b4d6a..b2c34e7 100644 > --- a/hw/qdev-monitor.c > +++ b/hw/qdev-monitor.c > @@ -426,6 +426,11 @@ DeviceState *qdev_device_add(QemuOpts *opts) > } > =20 > k =3D DEVICE_CLASS(obj); > + if (k->no_user) { Ack for this check... > + qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "a drive= r name"); > + error_printf_unless_qmp("Try with argument 'help' for a list.\= n"); ...but I'm not sure if this error reporting with QERR_... is still in the desired form, cc'ing Luiz. Andreas > + return NULL; > + } > =20 > /* find bus */ > path =3D qemu_opt_get(opts, "bus"); --=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