From: Luiz Capitulino <lcapitulino@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
Anthony Liguori <aliguori@us.ibm.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] qdev: obey no_user
Date: Mon, 7 Jan 2013 13:24:44 -0200 [thread overview]
Message-ID: <20130107132444.09d6e89d@doriath.home> (raw)
In-Reply-To: <50EAD9A1.7090407@suse.de>
On Mon, 07 Jan 2013 15:20:17 +0100
Andreas Färber <afaerber@suse.de> wrote:
> Am 17.12.2012 17:00, schrieb Christian Borntraeger:
> > since
> >
> > commit 18b6dade8c0799c48f5c5e124b8c407cd5e22e96
> > qdev: refactor device creation to allow bus_info to be set only in class
> >
> > A user can specify a device that is no_user.
> > For example on my i386 box, I can add a 2nd kvmvapic device.
> >
> > This patch checks for no-user and rejects the device_add.
> >
> > Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> > ---
> > hw/qdev-monitor.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > 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)
> > }
> >
> > k = DEVICE_CLASS(obj);
> > + if (k->no_user) {
>
> Ack for this check...
>
> > + qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "a driver 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.
The device_add command hasn't been converted to the qapi yet, so it's fine
to use qerror_report(). However, I'd drop the error_printf_unless_qmp() call,
as this has the potential of making the conversion harder.
>
> Andreas
>
> > + return NULL;
> > + }
> >
> > /* find bus */
> > path = qemu_opt_get(opts, "bus");
>
next prev parent reply other threads:[~2013-01-07 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 16:00 [Qemu-devel] [PATCH] qdev: obey no_user Christian Borntraeger
2013-01-07 14:05 ` Christian Borntraeger
2013-01-07 14:20 ` Andreas Färber
2013-01-07 15:24 ` Luiz Capitulino [this message]
2013-01-07 19:32 ` Anthony Liguori
2013-01-07 19:40 ` Peter Maydell
2013-01-07 20:12 ` Anthony Liguori
2013-01-07 20:16 ` Peter Maydell
2013-01-07 20:48 ` Anthony Liguori
2013-01-07 22:10 ` Andreas Färber
2013-01-07 22:20 ` Peter Maydell
2013-01-07 22:36 ` Andreas Färber
2013-01-07 22:48 ` Anthony Liguori
2013-01-07 20:40 ` Christian Borntraeger
2013-01-07 21:43 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130107132444.09d6e89d@doriath.home \
--to=lcapitulino@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).