All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, peter.maydell@linaro.org,
	peter.crosthwaite@xilinx.com, stefanha@redhat.com,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	qemu-devel@nongnu.org, "Anthony Liguori" <aliguori@amazon.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] IDs in QOM
Date: Tue, 07 Oct 2014 20:42:08 +0200	[thread overview]
Message-ID: <54343400.6080509@redhat.com> (raw)
In-Reply-To: <877g0bsp04.fsf@blackfin.pond.sub.org>

Il 07/10/2014 20:39, Markus Armbruster ha scritto:
>>>> >> > 1) always use the same restriction when a user creates objects;
>>>> >> >
>>>> >> > 2) do not introduce restrictions when a user is not using QemuOpts.
>>>> >> >
>>>> >> > We've been doing (2) so far; often it is just because QMP wrappers also
>>>> >> > used QemuOpts, but not necessarily.  So object_add just does the same.
>>> >>
>>> >> We've been doing (2) so far simply because we've never wasted a thought
>>> >> on it!  Since we're wasting thoughts now: which one do we like better?
>> >
>> > User interfaces other than QOM have been doing (2) too.
> From an implementation point of view, doing nothing is doing (2).
> 
> From an interface point of view, it's (2) only when interfaces bypassing
> QemuOpts exist.
> 
>> > netdev-add and device-add have been doing (2) because they use QemuOpts
>> > under the hood.
> qdev_device_add() uses QemuOpts.  Until relatively recently, that was
> the only way to create a qdev.  Nowadays, you could create one using QOM
> directly, bypassing QemuOpts's ID restriction.
> 
> netdev-add is similar iirc.
> 
>> > blockdev-add has been consciously doing (2) for node-name.
> Actually, we consciously fixed it to do (1):
> 
> commit 9aebf3b89281a173d2dfeee379b800be5e3f363e
> Author: Kevin Wolf <kwolf@redhat.com>
> Date:   Thu Sep 25 09:54:02 2014 +0200
> 
>     block: Validate node-name
>     
>     The device_name of a BlockDriverState is currently checked because it is
>     always used as a QemuOpts ID and qemu_opts_create() checks whether such
>     IDs are wellformed.
>     
>     node-name is supposed to share the same namespace, but it isn't checked
>     currently. This patch adds explicit checks both for device_name and
>     node-name so that the same rules will still apply even if QemuOpts won't
>     be used any more at some point.
>     
>     qemu-img used to use names with spaces in them, which isn't allowed any
>     more. Replace them with underscores.
> 
>> > chardev-add has been doing (1), and I'd argue that this is a bug in
>> > chardev-add.
> I'm not sure I got you here.
> 

Nevermind, I've consistently swapped (1) and (2).

Paolo

  reply	other threads:[~2014-10-07 18:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 11:59 [Qemu-devel] [PATCH] util: Emancipate id_wellformed() from QemuOpts Markus Armbruster
2014-09-30 15:30 ` Eric Blake
2014-10-01 12:33 ` [Qemu-devel] IDs in QOM (was: [PATCH] util: Emancipate id_wellformed() from QemuOpts) Markus Armbruster
2014-10-02 13:21   ` Stefan Hajnoczi
2014-10-02 13:26     ` [Qemu-devel] IDs in QOM Andreas Färber
2014-10-02 14:10       ` Stefan Hajnoczi
2014-10-02 14:21       ` Markus Armbruster
2014-10-02 14:28         ` Andreas Färber
2014-10-02 14:59           ` Markus Armbruster
2014-10-02 17:41             ` Paolo Bonzini
2014-10-07  8:01               ` Markus Armbruster
2014-10-07 10:03                 ` Paolo Bonzini
2014-10-07 12:16                   ` Markus Armbruster
2014-10-07 15:14                     ` Paolo Bonzini
2014-10-07 18:39                       ` Markus Armbruster
2014-10-07 18:42                         ` Paolo Bonzini [this message]
2014-10-07 18:41                       ` Kevin Wolf
2014-10-07 18:45                         ` Paolo Bonzini
2014-10-02 13:18 ` [Qemu-devel] [PATCH] util: Emancipate id_wellformed() from QemuOpts Stefan Hajnoczi
2014-10-02 13:42   ` Markus Armbruster
2014-10-02 14:11     ` Stefan Hajnoczi
2014-10-03  8:46 ` Stefan Hajnoczi

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=54343400.6080509@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.