All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] default slot used for vga device on q35 machines
@ 2013-08-01 19:37 Laine Stump
  2013-08-02  6:49 ` Gerd Hoffmann
  0 siblings, 1 reply; 8+ messages in thread
From: Laine Stump @ 2013-08-01 19:37 UTC (permalink / raw)
  To: qemu list

libvirt makes an assumption that if you specify "-vga qxl" instead of
"-device qxl-vga,...", the vga device will be connected to slot 2. I
learned this in a recent discussion about a bug caused by switching over
to using the former syntax (in order to support multiheaded QXL):

  https://bugzilla.redhat.com/show_bug.cgi?id=981094#c9

Since then, while working on proper support for the q35 machine type in
libvirt, I did a test run of:

  qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
-vnc :15 -vga std -usb

Then ran "query-pci" in the qmp monitor and found that the vga device is
put at slot 1 instead of slot 2.

My questions:

1) Is this difference intentional, or a bug?

2) If it's intentional, will the device always be at slot 1 (and trigger
an error if something else is also placed at slot 1), or is it just
picking the first unused slot? (that would *not* be good, because we
must be able to predict what device is in which slot and prevent them
from changing from run to run).

3) Does the qxl multihead support really require that the device be at
slot 2 (as stated in the above bugzilla commend)? Or is that just a
misunderstanding/overstatement?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-01 19:37 [Qemu-devel] default slot used for vga device on q35 machines Laine Stump
@ 2013-08-02  6:49 ` Gerd Hoffmann
  2013-08-02  7:23   ` Markus Armbruster
  2013-08-03 19:32   ` Laine Stump
  0 siblings, 2 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2013-08-02  6:49 UTC (permalink / raw)
  To: Laine Stump; +Cc: qemu list

  Hi,

>   qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
> -vnc :15 -vga std -usb
> 
> Then ran "query-pci" in the qmp monitor and found that the vga device is
> put at slot 1 instead of slot 2.
> 
> My questions:
> 
> 1) Is this difference intentional, or a bug?

The vga simply goes into the first free slot.  That happens to be #2
with i440fx and #1 with q35.

> 2) If it's intentional, will the device always be at slot 1 (and trigger
> an error if something else is also placed at slot 1), or is it just
> picking the first unused slot? (that would *not* be good, because we
> must be able to predict what device is in which slot and prevent them
> from changing from run to run).

The vga is the very first (pci) device being created (when selecting via
-vga), so it gets the slots mentioned above no matter what, even though
simply picking the first unused slot.

> 3) Does the qxl multihead support really require that the device be at
> slot 2 (as stated in the above bugzilla commend)? Or is that just a
> misunderstanding/overstatement?

It's not required at all.  The problem is that on older qemu versions
(pre-memory-api basically) it was impossible to create functional vga
devices via -device due to an initialization order issue.  Which implies
you have to use -vga instead, which in turn implies the vga ends up in
slot #2.  On i440fx, but q35 didn't exist yet back then ;)

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-02  6:49 ` Gerd Hoffmann
@ 2013-08-02  7:23   ` Markus Armbruster
  2013-08-02 16:46     ` Laine Stump
  2013-08-03 19:32   ` Laine Stump
  1 sibling, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2013-08-02  7:23 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu list, Laine Stump

Gerd Hoffmann <kraxel@redhat.com> writes:

>   Hi,
>
>>   qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
>> -vnc :15 -vga std -usb
>> 
>> Then ran "query-pci" in the qmp monitor and found that the vga device is
>> put at slot 1 instead of slot 2.
>> 
>> My questions:
>> 
>> 1) Is this difference intentional, or a bug?
>
> The vga simply goes into the first free slot.  That happens to be #2
> with i440fx and #1 with q35.

The slot used by -vga depends on the machine type, and can be expected
to remain stable.  We've kept it stable even for the machine type family
i440FX.

Nevertheless, if you require the graphics adapter to go into a specific
slot, I very much recommend to control its placement with -device.

[...]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-02  7:23   ` Markus Armbruster
@ 2013-08-02 16:46     ` Laine Stump
  2013-08-02 17:30       ` Markus Armbruster
  0 siblings, 1 reply; 8+ messages in thread
From: Laine Stump @ 2013-08-02 16:46 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Gerd Hoffmann, qemu list

On 08/02/2013 03:23 AM, Markus Armbruster wrote:
> Gerd Hoffmann <kraxel@redhat.com> writes:
>
>>   Hi,
>>
>>>   qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
>>> -vnc :15 -vga std -usb
>>>
>>> Then ran "query-pci" in the qmp monitor and found that the vga device is
>>> put at slot 1 instead of slot 2.
>>>
>>> My questions:
>>>
>>> 1) Is this difference intentional, or a bug?
>> The vga simply goes into the first free slot.  That happens to be #2
>> with i440fx and #1 with q35.
> The slot used by -vga depends on the machine type, and can be expected
> to remain stable.  We've kept it stable even for the machine type family
> i440FX.
>
> Nevertheless, if you require the graphics adapter to go into a specific
> slot, I very much recommend to control its placement with -device.

Right. We prefer explicitly specifying the pci address for everything,
but apparently in the case of multihead qxl devices, this isn't an
option (is this correct, or has there been a misunderstanding?)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-02 16:46     ` Laine Stump
@ 2013-08-02 17:30       ` Markus Armbruster
  0 siblings, 0 replies; 8+ messages in thread
From: Markus Armbruster @ 2013-08-02 17:30 UTC (permalink / raw)
  To: Laine Stump; +Cc: Gerd Hoffmann, qemu list

Laine Stump <laine@redhat.com> writes:

> On 08/02/2013 03:23 AM, Markus Armbruster wrote:
>> Gerd Hoffmann <kraxel@redhat.com> writes:
>>
>>>   Hi,
>>>
>>>>   qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
>>>> -vnc :15 -vga std -usb
>>>>
>>>> Then ran "query-pci" in the qmp monitor and found that the vga device is
>>>> put at slot 1 instead of slot 2.
>>>>
>>>> My questions:
>>>>
>>>> 1) Is this difference intentional, or a bug?
>>> The vga simply goes into the first free slot.  That happens to be #2
>>> with i440fx and #1 with q35.
>> The slot used by -vga depends on the machine type, and can be expected
>> to remain stable.  We've kept it stable even for the machine type family
>> i440FX.
>>
>> Nevertheless, if you require the graphics adapter to go into a specific
>> slot, I very much recommend to control its placement with -device.
>
> Right. We prefer explicitly specifying the pci address for everything,
> but apparently in the case of multihead qxl devices, this isn't an
> option (is this correct, or has there been a misunderstanding?)

If you find a case where -vga is still *required*, report it as a bug.

Elsewhere in thread, Gerd wrote it's not required for qxl multihead.
Suggest to work with Gerd to resolve remaining issues /
misunderstandings.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-02  6:49 ` Gerd Hoffmann
  2013-08-02  7:23   ` Markus Armbruster
@ 2013-08-03 19:32   ` Laine Stump
  2013-08-05  6:31     ` Gerd Hoffmann
  2013-08-05 15:04     ` Eric Blake
  1 sibling, 2 replies; 8+ messages in thread
From: Laine Stump @ 2013-08-03 19:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Libvirt, Guannan Ren, Gerd Hoffmann

On 08/02/2013 02:49 AM, Gerd Hoffmann wrote:
>   Hi,
>
>>   qemu-kvm -M q35 -nodefaults -nodefconfig -qmp unix:/tmp/qemu,server
>> -vnc :15 -vga std -usb
>>
>> Then ran "query-pci" in the qmp monitor and found that the vga device is
>> put at slot 1 instead of slot 2.
>>
>> My questions:
>>
>> 1) Is this difference intentional, or a bug?
> The vga simply goes into the first free slot.  That happens to be #2
> with i440fx and #1 with q35.


It sounds like it's a safe bet to assume that -vga will put the device
on slot 2 for pc machinetypes and slot 1 for q35, no matter what other
devices there are, since -vga is always initialized first. Correct? Do
you see any chance that might change in the future? (e.g. due to some
other new device that needs to be initialized even before vga)


>
>> 2) If it's intentional, will the device always be at slot 1 (and trigger
>> an error if something else is also placed at slot 1), or is it just
>> picking the first unused slot? (that would *not* be good, because we
>> must be able to predict what device is in which slot and prevent them
>> from changing from run to run).
> The vga is the very first (pci) device being created (when selecting via
> -vga), so it gets the slots mentioned above no matter what, even though
> simply picking the first unused slot.
>
>> 3) Does the qxl multihead support really require that the device be at
>> slot 2 (as stated in the above bugzilla commend)? Or is that just a
>> misunderstanding/overstatement?
> It's not required at all.  The problem is that on older qemu versions
> (pre-memory-api basically) it was impossible to create functional vga
> devices via -device due to an initialization order issue.  Which implies
> you have to use -vga instead, which in turn implies the vga ends up in
> slot #2.  On i440fx, but q35 didn't exist yet back then ;)

Are you saying that it's still required to use -vga instead of -device
qxl-vga for pc machinetype? Or that it was needed at one time, but that
is no longer the case? If the latter, is there a reliable way to make
the decision whether or not we need to use -vga?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-03 19:32   ` Laine Stump
@ 2013-08-05  6:31     ` Gerd Hoffmann
  2013-08-05 15:04     ` Eric Blake
  1 sibling, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2013-08-05  6:31 UTC (permalink / raw)
  To: Laine Stump; +Cc: Libvirt, Guannan Ren, qemu-devel

  Hi,

>>> 1) Is this difference intentional, or a bug?
>> The vga simply goes into the first free slot.  That happens to be #2
>> with i440fx and #1 with q35.
> 
> It sounds like it's a safe bet to assume that -vga will put the device
> on slot 2 for pc machinetypes and slot 1 for q35, no matter what other
> devices there are, since -vga is always initialized first. Correct?

Yes.

> Do
> you see any chance that might change in the future? (e.g. due to some
> other new device that needs to be initialized even before vga)

Highly unlikely.  Also libvirt will switch over to use -device for vga
cards, which will make this a moot point.

>>> 3) Does the qxl multihead support really require that the device be at
>>> slot 2 (as stated in the above bugzilla commend)? Or is that just a
>>> misunderstanding/overstatement?
>> It's not required at all.  The problem is that on older qemu versions
>> (pre-memory-api basically) it was impossible to create functional vga
>> devices via -device due to an initialization order issue.  Which implies
>> you have to use -vga instead, which in turn implies the vga ends up in
>> slot #2.  On i440fx, but q35 didn't exist yet back then ;)
> 
> Are you saying that it's still required to use -vga instead of -device
> qxl-vga for pc machinetype? Or that it was needed at one time, but that
> is no longer the case? If the latter, is there a reliable way to make
> the decision whether or not we need to use -vga?

libvirt has started using -device for vga cards, to be able to place
them in any pci slot.  IIRC it's used for qemu 1.1+ or 1.2+.  That works
fine for all vga cards except qxl.  The bug which broke it for qxl will
be fixed in 1.6 (and probably 1.5.3 too).

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] default slot used for vga device on q35 machines
  2013-08-03 19:32   ` Laine Stump
  2013-08-05  6:31     ` Gerd Hoffmann
@ 2013-08-05 15:04     ` Eric Blake
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Blake @ 2013-08-05 15:04 UTC (permalink / raw)
  To: Laine Stump; +Cc: Libvirt, Guannan Ren, qemu-devel, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]

On 08/03/2013 01:32 PM, Laine Stump wrote:

>>>
>>> 1) Is this difference intentional, or a bug?
>> The vga simply goes into the first free slot.  That happens to be #2
>> with i440fx and #1 with q35.
> 
> 
> It sounds like it's a safe bet to assume that -vga will put the device
> on slot 2 for pc machinetypes and slot 1 for q35, no matter what other
> devices there are, since -vga is always initialized first. Correct? Do
> you see any chance that might change in the future? (e.g. due to some
> other new device that needs to be initialized even before vga)

Any future qemu will be new enough to not require the use of -vga, so we
only have to worry about the behavior of 1.5 and earlier with regards to
placement of -vga.

> 
> 
>>
>>> 2) If it's intentional, will the device always be at slot 1 (and trigger
>>> an error if something else is also placed at slot 1), or is it just
>>> picking the first unused slot? (that would *not* be good, because we
>>> must be able to predict what device is in which slot and prevent them
>>> from changing from run to run).
>> The vga is the very first (pci) device being created (when selecting via
>> -vga), so it gets the slots mentioned above no matter what, even though
>> simply picking the first unused slot.
>>
>>> 3) Does the qxl multihead support really require that the device be at
>>> slot 2 (as stated in the above bugzilla commend)? Or is that just a
>>> misunderstanding/overstatement?
>> It's not required at all.  The problem is that on older qemu versions
>> (pre-memory-api basically) it was impossible to create functional vga
>> devices via -device due to an initialization order issue.  Which implies
>> you have to use -vga instead, which in turn implies the vga ends up in
>> slot #2.  On i440fx, but q35 didn't exist yet back then ;)
> 
> Are you saying that it's still required to use -vga instead of -device
> qxl-vga for pc machinetype? Or that it was needed at one time, but that
> is no longer the case? If the latter, is there a reliable way to make
> the decision whether or not we need to use -vga?

Regarding the decision on whether to use -device or -vga, our hands are
tied.  With qemu 1.5 or earlier, we HAVE to use -vga, where spice
initialization had a bug such that use of -device would not display the
mouse.  That bug has been fixed for qemu 1.6, so for qemu 1.6, we prefer
to use -device.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-05 15:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01 19:37 [Qemu-devel] default slot used for vga device on q35 machines Laine Stump
2013-08-02  6:49 ` Gerd Hoffmann
2013-08-02  7:23   ` Markus Armbruster
2013-08-02 16:46     ` Laine Stump
2013-08-02 17:30       ` Markus Armbruster
2013-08-03 19:32   ` Laine Stump
2013-08-05  6:31     ` Gerd Hoffmann
2013-08-05 15:04     ` Eric Blake

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.