[elbe-devel] [PATCH] initvm: Remove cirrus vga device

Holger Dengler holger at hdengler.de
Tue Jun 21 21:10:32 CEST 2022


Hi Bastian,

On 21.06.22 18:21, Bastian Germann wrote:
> The cirrus vga device gives problems on Debian sid.
> Remove the complete video section to make use of the default,
> which is provided on an existing graphics.

With your patch, I still get errors on sid while starting the initvm. It looks like, that the video device is now generated for a PCI device, which is already dynamically occupied with the virtio-net-pci. Here is the error message:

----------------------
$ ./elbe initvm start
libvirt: QEMU Driver error : internal error: qemu unexpectedly closed the monitor: 2022-06-21T18:46:12.566958Z kvm: -device {"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}: PCI: slot 2 function 0 not available for cirrus-vga, in use by virtio-net-pci,id=(null)
Traceback (most recent call last):
  File "/home/holger/git/elbe/elbe/./elbe", line 60, in <module>
    cmdmod.run_command(sys.argv[2:])
  File "/home/holger/git/elbe/elbe/elbepack/commands/initvm.py", line 96, in run_command
    action.execute(directory, opt, args[1:])
  File "/home/holger/git/elbe/elbe/elbepack/initvmaction.py", line 166, in execute
    self.initvm.create()
  File "/usr/lib/python3/dist-packages/libvirt.py", line 1353, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2022-06-21T18:46:12.566958Z kvm: -device {"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}: PCI: slot 2 function 0 not available for cirrus-vga, in use by virtio-net-pci,id=(null)
----------------------

I'm not sure, if this error is specific to my configuration or if it also occurs on other sid installations. For me, the following workaround get my initvm up again:

1. backup /etc/libvirt/qemu/initvm.xml (sudo cat /etc/libvirt/qemu/initvm.xml > ~/initvm.xml)
2. undefine domain "initvm" (virsh --connect qemu:///system undefine initvm)
3. edit ~/initvm.xml and change the slot of the video device from 0x02 to 0x05 (diff see below)
4. re-define the domain "initvm" with the new config (virsh --connect qemu:///system define ~/initvm.xml)

----------------------
$ diff -u initvm.xml_orig initvm.xml
--- initvm.xml_orig	2022-06-21 21:05:48.968899632 +0200
+++ initvm.xml	2022-06-21 21:05:09.816031081 +0200
@@ -61,7 +61,7 @@
     <audio id='1' type='spice'/>
     <video>
       <model type='cirrus' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
     </video>
     <memballoon model='none'/>
     <rng model='virtio'>
----------------------

> 
> Quoting from the libvirt website:
> """
> The video element is the container for describing video devices.
> For backwards compatibility, if no video is set but there is a graphics in
> domain xml, then libvirt will add a default video according to the guest type.
> """
> 
> Link: https://libvirt.org/formatdomain.html
> Signed-off-by: Bastian Germann <bage at linutronix.de>
> ---
>  elbepack/init/libvirt.xml.mako | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/elbepack/init/libvirt.xml.mako b/elbepack/init/libvirt.xml.mako
> index b91b849bc5..6451be1c6f 100644
> --- a/elbepack/init/libvirt.xml.mako
> +++ b/elbepack/init/libvirt.xml.mako
> @@ -67,9 +67,6 @@ xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
>      <input type='mouse' bus='ps2' />
>      <input type='keyboard' bus='ps2' />
>      <graphics type='spice' autoport='yes' />
> -    <video>
> -      <model type='cirrus' vram='9216' heads='1' />
> -    </video>
>      <rng model='virtio'>
>        <backend model='random' />
>      </rng>

-- 
Gruß,
Holger Dengler
--
holger at hdengler.de


More information about the elbe-devel mailing list