qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Benjamin Herrenschmidt <benh@au1.ibm.com>,
	qemu-devel@nongnu.org, zhlcindy@linux.vnet.ibm.com,
	li zhang <zhlcindy@gmail.com>
Subject: Re: [Qemu-devel] [qemu-devel][RFC] Enable usb with default options
Date: Thu, 07 Jun 2012 19:51:53 +0800	[thread overview]
Message-ID: <4FD095D9.2020005@codemonkey.ws> (raw)
In-Reply-To: <m3haunqvxl.fsf@blackfin.pond.sub.org>

On 06/07/2012 06:05 PM, Markus Armbruster wrote:
> [cc: Dan to give him a chance to correct whatever underinformed nonsense
> I might spout on libvirt]

Don't see Dan on CC so I'll add him...


> Anthony Liguori<aliguori@us.ibm.com>  writes:
 >>
>> I think we have a different world view.
>>
>> I see 'qemu -machine foo' as creating some useful variant of 'foo'
>> where 'foo' is a user visible concept like a PC, or a Beagle board, or
>> a pSeries machine.
>>
>> If I went to Fry's an bought a PC, I'd expect to plug it in and for it
>> to have everything I needed including USB.  If I'm cheap, maybe I want
>> to lower the amount of RAM or reuse the VGA card I bought for
>> Christmas to play Halo 15 with.
>>
>> I see machine options as a way to customize that PC.  Maybe I want to
>> not include USB by default because I have some religious opposition to
>> protocols that start with 'U'.
>>
>> Machine configuration options are the QEMU equivalent of the drop-down
>> box where you select options when buying a laptop from Dell.
>>
>> '-nodefault' is like buying a PC out of a back of an unmarked van on a
>> street corner.  God knows why it doesn't come with a serial port.
>> Maybe that got broken while it was being stolen during a break in.
>> Maybe it's got a VGA card but no disk controller because they sold the
>> VGA card separately to make more money.
>
> Entertaining imagery, but hardly a fair description of what -nodefaults
> does.  -nodefaults is shorthand for "deselect everything in the drop
> down box".  God knows why the drop down box has "disable serial port",
> but it has.  God knows why the drop down box is so ugly and hard to use,
> but it is.  Maybe we could happily do without the "deselect everything"
> shorthand if the drop down box didn't suck so much, but it does.
>
>> What libvirt really wants is to buy the *components* of a PC and build
>> it from scratch.  They want to separately buy the mother board, the
>> case, the graphics adapter, etc.  libvirt is the 16-year kid with
>> pimples who spends Saturday night reading Newegg to find the new 750W
>> power supply that's water cooled and tricked out with LEDs that I'm
>> sure we all were at some point in our lives.
>
> Again, entertaining imagery, but hardly a fair description of libvirt's
> motivation.
>
> Things libvirt really wants:
>
> * Stable names.  Many default devices don't get any.  Yes, we can fix
>    that.  Until we do, the only way to get names is to suppress default
>    devices and define them yourself.
>
> * Expose QEMU features to its users.  In particular, if a device is
>    optional in QEMU, libvirt wants to be able to control its "enable"
>    bit.  As it is, -nodefaults is the only way that works the same for
>    all default devices, and for some of them it's the only way that works
>    at all.

I'll resist the urge to extend the analogy and just keep it simple.

-machine is an objectively better interface for achieving the above.  Here's why:

1) There is no way to determine when the semantics of -nodefault changes and no 
clear compatibility statement.

  a) Would it be okay to make -nodefault suppress the the IDE controller for -M 
pc at this point in time?

  b) Would it be okay to add USB by default and make -nodefault disable it?

  c) How does libvirt figure out when any of the above happens?

2) There is no way to figure out what -nodefault does without deep code 
inspection since it depends on each machine.

3) -machine is both discoverable (you can see when new options are added), but 
also has the ability to support compatibility.  If we decide to add usb by 
default, libvirt can see that 'usb' has been added and disable it.  If we decide 
to make the IDE device hide-able, we can add an 'ide' option and default it to True.

4) The -machine option supports sane backporting.  Since you can discover 
individual features of -machine, libvirt can deal with any combination of 
features being available.

We didn't have -machine when -nodefaults was introduces.  Now that we do, we 
should make good use of it.

Regards,

Anthony Liguori

>
>> So I guess this is the long way of saying, let's not provide an
>> interface from the back of an unmarked van.  Let's either provide a
>> nice drop-down menu (-machine options) or provide a Newegg catalog
>> that has every component in it.
>
> I doubt we're actually disagreeing on anything substantial.
>
> I'm sure we can improve on -nodefaults.  But let's not break its core
> feature "disable all default devices that can be disabled" before we
> actually provide a working alternative that satisfies the needs of its
> users.
>

  reply	other threads:[~2012-06-07 11:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  9:48 [Qemu-devel] [qemu-devel][RFC] Enable usb with default options li zhang
2012-06-06  2:52 ` li zhang
2012-06-06  3:31   ` Benjamin Herrenschmidt
2012-06-06  5:42     ` Anthony Liguori
2012-06-06  6:03       ` li zhang
2012-06-06 21:13       ` Benjamin Herrenschmidt
2012-06-07  1:15         ` Anthony Liguori
2012-06-07  3:00           ` Benjamin Herrenschmidt
2012-06-07  3:03             ` Anthony Liguori
2012-06-07  4:52             ` li zhang
2012-06-07  4:39           ` li zhang
2012-06-07  4:43             ` Anthony Liguori
2012-06-07  4:53               ` li zhang
2012-06-07  8:07           ` Markus Armbruster
2012-06-07  9:19             ` Anthony Liguori
2012-06-07 10:05               ` Markus Armbruster
2012-06-07 11:51                 ` Anthony Liguori [this message]
2012-06-12  8:06                   ` Markus Armbruster
2012-06-07  8:32         ` Hans de Goede
2012-06-07  8:40           ` Benjamin Herrenschmidt
2012-06-07  8:49             ` Paolo Bonzini
2012-06-07  8:52             ` Hans de Goede
2012-06-07  9:05               ` Gerd Hoffmann
2012-06-07  9:17                 ` Benjamin Herrenschmidt
2012-06-07  9:29                   ` Li Zhang
2012-06-07  9:16               ` Benjamin Herrenschmidt
2012-06-07  9:50                 ` Hans de Goede
2012-06-07 11:19                   ` Benjamin Herrenschmidt
2012-06-07 11:35                   ` Gerd Hoffmann
2012-06-07  8:54             ` Gerd Hoffmann
2012-06-06 22:14     ` Andreas Färber
  -- strict thread matches above, loose matches on Subject: below --
2012-06-05  7:19 Li Zhang

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=4FD095D9.2020005@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=benh@au1.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhlcindy@gmail.com \
    --cc=zhlcindy@linux.vnet.ibm.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 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).