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

On 06/07/2012 04:07 PM, Markus Armbruster wrote:
> Anthony Liguori<aliguori@us.ibm.com>  writes:
>
>> On 06/07/2012 05:13 AM, Benjamin Herrenschmidt wrote:
>>> On Wed, 2012-06-06 at 13:42 +0800, Anthony Liguori wrote:
>>>> On 06/06/2012 11:31 AM, Benjamin Herrenschmidt wrote:
>>>>> On Wed, 2012-06-06 at 10:52 +0800, li zhang wrote:
>>>>>> Hi Anthony,
>>>>>>
>>>>>>
>>>>>> Any comment on this?
>>>>>
>>>>> Allright, this is all quite confusing...
>>>>>
>>>>> He's what I think should happen:
>>>>>
>>>>> When no option is passed -at-all-, we should have vga std and usb ohci +
>>>>> usb mouse + usb ps2.
>>>>>
>>>>> When -nodefault is passed, we should have none of the above.
>>>>
>>>> -nodefault is a pretty ugly hack.  I don't think there's any good reason to
>>>> involve -nodefault into this discussion.
>>>
>>> Well, it's pretty fundamental to how libvirt does thing afaik...
>>>
>>> Take pseries, by "default" today it has a vscsi, a vterm etc.... but
>>> with -nodefault, none of this so libvirt can create them manually.
>>
>> You misunderstand what I'm saying.
>>
>> -nodefault is a dumb option.  It's semantics are poorly defined
>> because it depends on machine.  Further complicating those semantics
>> by adding more magic for -M spapr just makes the situation worse.
>
> Without -nodefaults, you get the machine the developers think most
> people want.  Example: you may get a default serial device.  Whether you
> get one and which one you get depends on the machine.
>
> With -nodefaults, you get a variant of the same machine with those
> optional devices omitted the developers think somebody might want to
> suppress or define himself.
>
> Both are "defined" the same way: you get what you get, and the
> developers promise not to change it too much.
>
> For some kinds of devices, there's magic to make user-defined devices
> replace default devices.  Example: -serial and -device isa-serial
> suppress the default serial device.
>
> For some kinds of devices, there's a device-specific way to suppress
> default devices.  Example: -serial none suppresses the default serial
> device.  Counter-example: you can't suppress the default floppy
> (frontend if the machine supports floppies, backend whether it does or
> not) other than with -nodefaults.
>
> The truly "poor" bit in -nodefaults is the name: I keep reading "node
> faults" %-)
>
>> I'm suggesting to make use of the -machine option to allow usb to be disabled.  So:
>>
>> qemu-system-ppc64 -machine type=spapr,usb=off
>>
>> libvirt can still happily name the usb controller whatever it wants.
>> But the end result is a less magical command line.
>
> The USB host controller is currently disabled by default on all
> machines.  If we enable it by default (which I think is a good idea), we
> may want to give users a way to suppress it.
>
> Your proposed -M parameter usb is yet another device-specific way to
> suppress default devices.  We got a few, one more won't kill us.  Much
> better would be adding a device-independent way to suppress a default
> device.
>
> Adding default USB suppression without having -nodefaults cover it is
> something new, though: -nodefaults no longer omits optional devices "the
> developers think somebody might want to suppress or define himself".
> Feels like reneging on what -nodefaults promised to do.  I'd recommend
> to think twice about that.

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.

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.

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.

Regards,

Anthony Liguori

  reply	other threads:[~2012-06-07  9:19 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 [this message]
2012-06-07 10:05               ` Markus Armbruster
2012-06-07 11:51                 ` Anthony Liguori
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=4FD07219.8040500@us.ibm.com \
    --to=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).