Bug 1922093

Summary: Should fail to define guest xml with non-virtio video devices using packed virtqueues
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Lili Zhu <lizhu>
Component: libvirtAssignee: khanicov
Status: CLOSED ERRATA QA Contact: zhentang <zhetang>
Severity: low Docs Contact:
Priority: low    
Version: 8.4CC: jdenemar, jsuchane, khanicov, knoel, lmen, mprivozn, virt-maint, xuzhang
Target Milestone: rcKeywords: Triaged, Upstream
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.3.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 07:51:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 7.2.0
Embargoed:

Description Lili Zhu 2021-01-29 08:49:49 UTC
Description of problem:
Should fail to define guest xml with non-virtio video devices using packed virtqueues

Version-Release number of selected component (if applicable):
qemu-kvm-5.2.0-3.module+el8.4.0+9499+42e58f08.x86_64
libvirt-7.0.0-2.module+el8.4.0+9520+ef609c5f.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a guest xml with video devices using packed virtqueues
# cat guest.xml
... 
 <video>
      <driver packed='on'/>
      <model type='vga' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </video>
...

2. define guest xml
# virsh define guest.xml 
Domain 'avocado-vt-vm1' defined from guest.xml

3. start the guest 
# virsh start avocado-vt-vm1 
error: Failed to start domain 'avocado-vt-vm1'
error: internal error: qemu unexpectedly closed the monitor: 2021-01-29T08:25:40.353439Z qemu-kvm: -device VGA,id=video0,vgamem_mb=16,bus=pci.8,addr=0x0,packed=on: Property 'VGA.packed' not found


Expected results:
As only virtio devices support packed virtqueues, it's better to fail to define or edit xml with non-virtio video devices using packed virtqueues

Comment 1 khanicov 2021-03-10 17:07:04 UTC
Patches proposed on the list:
https://listman.redhat.com/archives/libvir-list/2021-March/msg00458.html

Comment 2 khanicov 2021-03-19 12:56:07 UTC
Merged upstream as:

b5d25b8183 domain_validate: Move virDomainCheckVirtioOptionsAreAbsent() a few lines forward
v7.1.0-250-gb5d25b8183

25d3b41e5e domain_validate: XML validate that non-virtio video devices have none virtio options
v7.1.0-251-g25d3b41e5e

Comment 5 zhentang 2021-06-08 06:50:06 UTC
VERIFIED
==========================
Environment:
Compiled against library: libvirt 7.4.0
Using library: libvirt 7.4.0
Using API: QEMU 7.4.0
Running hypervisor: QEMU 5.2.0

xml data:
...

<video>
      <driver packed='on'/>
      <model type='vga' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x01' function='0x0'/>
    </video>
...
Result:
# virsh define tztest_bug.xml 
error: Failed to define domain from tztest_bug.xml
error: unsupported configuration: packed driver option is only supported for virtio devices

Comment 7 errata-xmlrpc 2021-11-16 07:51:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684