From: Markus Armbruster <armbru@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
Alexey Kardashevskiy <aik@ozlabs.ru>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Li Zhang <zhlcindy@linux.vnet.ibm.com>,
Paul Mackerras <paulus@samba.org>,
Avik Sil <aviksil@linux.vnet.ibm.com>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] -vga std vs. -device VGA
Date: Fri, 15 Nov 2013 10:23:10 +0100 [thread overview]
Message-ID: <87txfehvcx.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <AF3EB113-2377-49EB-BEFD-6F46901542C3@suse.de> (Alexander Graf's message of "Thu, 14 Nov 2013 23:28:17 -0500")
Alexander Graf <agraf@suse.de> writes:
> Am 14.11.2013 um 20:25 schrieb Alexey Kardashevskiy <aik@ozlabs.ru>:
>
>> On 11/15/2013 10:03 AM, Peter Maydell wrote:
>>> On 14 November 2013 22:32, Benjamin Herrenschmidt
>>> <benh@kernel.crashing.org> wrote:
>>>> On Thu, 2013-11-14 at 17:23 -0500, Alexander Graf wrote:
>>>>> Yes. But I think it's the correct thing to do in this case. X86 also
>>>>> doesn't create a USB controller like we would have to. Our pseries
>>>>> platform just doesn't have a legacy PC/AT keyboard controller.
>>>>
>>>> Sure, but that implies that -nodefaults -device VGA creates a working
>>>> usable machine on x86 and not on pseries...
>>>
>>> Sounds plausible. Anything using -nodefaults has to have
>>> knowledge of every QEMU machine type it wants to use
>>> so it can know which devices need adding in order to get
>>> various functionality. ('-device VGA' doesn't work at all on
>>> some, for instance). If you ask for full manual control, you
>>> get full manual control :-)
>>
>> That is ok and I asked our libvirt person to fix it (Hi Li :) ).
>>
>> What I still do not completely understand is the principle used about
>> automatic device creation. Specifically, "-device VGA" creates only VGA
>> (and that is understandable) but "-vga std" creates more devices, if if
>> used together with "-nodefaults".
>>
>> Is it because "-device" must create only what it is told to create and
>> others non-"-device" options (-usb? -vga? -machine ...? any!) can
>> auto-create whatever they want (well, what seems reasonable to create for
>> the specific arch)?
Semantics of -device are straightforward by design: add this device, no
more, no less, no ifs, no buts.
There are a number of convenience and legacy options to create devices.
* Some of them are desugared by generic code into an equivalent -device
option (example: -balloon). Simple, clean semantics.
* Some are parsed by generic code, then passed to device code (example:
-soundhw), or left in a place where device code can find it (example:
-drive if=scsi). Which device model processes the option can depend
on what devices are registered (-soundhw), or actually created (-drive
if=scsi). Device code interprets the arguments (if any) however it
sees fit. If there's no suitable device, a fatal error is reported
for some options (-soundhw), while others get silently ignored.
* Some are parsed by generic code, then left in a place where board code
can find them (example: -serial left in serial_hds[], -vga left in
vga_interface_type, -drive if=ide left behind drive_get(IF_IDE, ...)).
What the board does with them is entirely up to the board.
Options the board doesn't know are ignored silently. Invalid known
options may be ignored silently, ignored with a warning, or treated as
fatal error. For valid known options, the board creates whatever
devices it sees fit. This can be plain (create the appropriate serial
device with default properties), or it can be funky (create devices
"VGA", "usb-kbd" and "usb-mouse").
Guess which of the three I like best.
Regarding board code interpreting options in funky ways: in my opinion,
funky should be avoided. Doesn't mean the problem isn't worthy
(providing nice defaults with -M pseries certainly is), just that a
non-funky solution would be cleaner.
Without -nodefaults, you get a board that may include some optional
devices believed to be convenient for most users. With -nodefaults, you
get a device without them. Details:
* Suppress the default serial device, just like -serial, -device
isa-serial, and machine->no_serial do.
* Suppress the default parallel device, just like -serial, -device
isa-parallel, and machine->no_parallel do.
* Suppress the default virtcon device, just like -virtiocon, -device
virtio-serial-pci, -device virtio-serial-s390, -device virtio-serial,
and !machine->use_virtcon do.
* Much more; I trust you get the picture.
When the optional device is created by board code (which is typically
the case), the exact effect of -nodefaults on it depends on the board.
> Yeah, you can use QEMU as the interface to the user, then you want to
> be easy and smart. Or you can use QEMU as interface to a management
> stack. Then you want to be as precise and deterministric as
> possible. -device falls into the latter category.
Yes, although opinions on what exactly is "easy" or "smart" are bound to
differ at times ;)
Management applications generally want -device with -nodefaults for full
control and predictability, especially across QEMU updates.
next prev parent reply other threads:[~2013-11-15 9:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 5:01 [Qemu-devel] -vga std vs. -device VGA Alexey Kardashevskiy
2013-11-14 6:01 ` Benjamin Herrenschmidt
2013-11-14 9:37 ` Alexey Kardashevskiy
2013-11-14 13:04 ` Alexander Graf
2013-11-14 20:28 ` Benjamin Herrenschmidt
2013-11-14 20:49 ` Peter Maydell
2013-11-14 22:23 ` Alexander Graf
2013-11-14 22:32 ` Benjamin Herrenschmidt
2013-11-14 22:41 ` Alexander Graf
2013-11-14 22:45 ` Anthony Liguori
2013-11-15 12:04 ` Paolo Bonzini
2013-11-15 16:43 ` Alexey Kardashevskiy
2013-11-14 22:46 ` Anthony Liguori
2013-11-14 23:03 ` Peter Maydell
2013-11-14 23:31 ` Benjamin Herrenschmidt
2013-11-15 1:25 ` Alexey Kardashevskiy
2013-11-15 4:28 ` Alexander Graf
2013-11-15 9:23 ` Markus Armbruster [this message]
2013-11-14 13:11 ` Eric Blake
2013-11-15 12:08 ` Paolo Bonzini
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=87txfehvcx.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=aviksil@linux.vnet.ibm.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--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 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.