On Tue, Aug 27, 2024 at 21:36:29 -0000, bo0od--- via Users wrote:
Full VM xml:
```
[...]
<audio id='1' type='spice'/>
<video>
<model type='virtio' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0'/>
<acceleration accel3d='yes' accel2d='yes'/>
<gl enable='yes'/>
</video>
<watchdog model='itco' action='reset'/>
<memballoon model='none'/>
<rng model='virtio'>
<rate bytes='1024' period='1000'/>
<backend model='random'>/dev/random</backend>
<address type='pci' domain='0x0000' bus='0x06'
slot='0x00' function='0x0'/>
</rng>
</devices>
</domain>
```
But it will always show:
```
error: XML document failed to validate against schema: Unable to validate doc against
/usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content
```
Any idea how to resolve this?
Error from a XML validator with more reasonable error reporting is:
/tmp/asdfasdf.xml:134:50: error: element "acceleration" not allowed here;
expected the element end-tag or element "acpi", "alias" or
"driver"
/tmp/asdfasdf.xml:135:25: error: element "gl" not allowed here; expected the
element end-tag or element "acpi", "alias" or "driver"
Per
https://www.libvirt.org/formatdomain.html#video-devices
The '<acceleration' element is supposed to be a sub-element of
'model':
<devices>
<video>
<model type='vga' vram='16384' heads='1'>
<acceleration accel3d='yes' accel2d='yes'/>
</model>
<driver name='qemu'/>
</video>
</devices>
And '<gl' is supposed to be a child of 'graphics' instead of
'<video'.
As you have one at '<graphics' just delete it.
With '<video>' like this it validates properly:
<video>
<model type='virtio' heads='1' primary='yes'>
<acceleration accel3d='yes' accel2d='yes'/>
</model>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0'/>
</video>
Although I don't know where you got that definition because the qemu
driver doesn't support 'accel2d' altogether:
$ virsh define /tmp/asdfasdf.xml
error: Failed to define domain from /tmp/asdfasdf.xml
error: unsupported configuration: qemu does not support the accel2d setting
In src/qemu/qemu_validate.c in the function qemuValidateDomainDeviceDefVideo()
the check is as follows:
if (video->accel && video->accel->accel2d == VIR_TRISTATE_BOOL_YES)
{
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("qemu does not support the accel2d setting"));
return -1;
}
Thus with no exception.
Thus the final working 'video' is:
<video>
<model type='virtio' heads='1' primary='yes'>
<acceleration accel3d='yes'/>
</model>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0'/>
</video>
Which is accepted:
$ virsh define /tmp/asdfasdf.xml
Domain 'Whonix-Gateway' defined from /tmp/asdfasdf.xml