[libvirt-users] Cannot Write xvga=yes in xml file

Laine Stump laine at redhat.com
Fri Jan 5 17:21:17 UTC 2018

(Please don't top-post your replies on this list. Post them inline with
the text you are responding to)

On 01/05/2018 02:58 AM, Rogue S.T wrote:
> Yes, I can use guest with this way, But when i hot-add my graphics card
> , Guest will  reboot.

It's very .... "ambitious" to expect hot-plug of a vfio-assigned
graphics card to work properly. I doubt that has been tested much, if at
all - vfio and QEMU might handle it properly, but it's very likely that
the guest OS would not.

> So i want to try it with <hostdev>. Somehow , If i use "hostdev" without
> xvga , my screen will be black.
> If we have no  hostdev, do you have other methods can help me to use
> hot-plug my graphics card? 

I didn't say there is no <hostdev>, I said that the <hostdev> element
has no attribute called "xvga".

QEMU itself *does* have a commandline option called "xvga" though, and
that can be set using libvirt's "QEMU commandline passthrough",
following the directions on the page that I linked in my original
response. Of course, QEMU commandline passthrough can't be used when
hot-plugging devices - maybe that's what you're trying to point out; if
that's really your problem, then there is no solution (other than to not
hot-plug the GPU).

> At 2018-01-04 23:27:52, "Laine Stump" <laine at redhat.com> wrote:
>>On 12/20/2017 09:40 PM, Rogue S.T wrote:
>>> Hello,my system info:
>>>     virsh verison
>>>     Compiled against library: libvirt 3.9.0
>>>     Using library: libvirt 3.9.0 
>>>     Using API: QEMU 3.9.0
>>>     Running hypervisor: QEMU 2.10.90
>>> And i want to pass through my gpu to my window 7 guest with <hostdev>,
>>> next line is comand i use:
>>>      <hostdev mode='subsystem' type='pci' managed='yes' xvga='yes'>
>>I'm not sure where you got the idea that libvirt's <hostdev> element had
>>an attribute called "xvga", but it doesn't.
>>If your GPU needs to have QEMU's xvga setting turned on, this posting
>>from ALex's blog explains how to do it using libvirt's QEMU commandline
>>I would recommend reading all the other postings in his blog as well, as
>>they are very informative.
>>>       <source>
>>>         <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
>>>       </source>
>>>       <rom bar='on' file='/root/gpu.dump'/>
>>>       <address type='pci' domain='0x0000' bus='0x00' slot='0x07'
>>> function='0x0'/>
>>>     </hostdev>
>>> But i get this error: 
>>>         XML document failed to validate against schema: Unable to
>>> validate doc against /ocl/share/libvirt/schemas/domain.rng
>>>         Extra element devices in interleave
>>>         Element domain failed to validate content
>>> If i delete xvga='yes',it's ok, but i get a other question, my display
>>> is not light.
>>> _______________________________________________
>>> libvirt-users mailing list
>>> libvirt-users at redhat.com
>>> https://www.redhat.com/mailman/listinfo/libvirt-users

More information about the libvirt-users mailing list