Bug 1745868

Summary: Remove the support for 'virtio-input-host-pci-{non-}transitional model
Product: Red Hat Enterprise Linux 9 Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Ján Tomko <jtomko>
libvirt sub component: General QA Contact: Lili Zhu <lizhu>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: jdenemar, jsuchane, lizhu, lmen, meili, pkrempa, virt-maint, xuzhang, yafu
Version: 9.0Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-8.1.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:03:03 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: 8.1.0
Embargoed:

Description Fangge Jin 2019-08-27 06:15:03 UTC
Description of problem:


Version-Release number of selected component (if applicable):
libvirt-5.6.0-2.virtcov.el8.x86_64
qemu-kvm-4.1.0-4.module+el8.1.0+4020+16089f93.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Try to start a vm with virtio-transitional passthrough input device:
# virsh dumpxml vm2
...
    <input type='passthrough' bus='virtio' model='virtio-transitional'>
      <source evdev='/dev/input/by-path/pci-0000:00:14.0-usb-0:10:1.0-event-kbd'/>
    </input>

# virsh start vm2
error: Failed to start domain vm2
error: internal error: qemu unexpectedly closed the monitor: 2019-08-27T02:25:35.460673Z qemu-kvm: -device virtio-input-host-pci-transitional,id=input1,evdev=/dev/input/by-path/pci-0000:00:14.0-usb-0:10:1.0-event-kbd,bus=pci.19,addr=0x2: 'virtio-input-host-pci-transitional' is not a valid device model name

2.Check the supported input device by qemu, find that it doesn't support :
# /usr/libexec/qemu-kvm -device ?|grep input -i
Input devices:
name "virtio-input-host-device", bus virtio-bus
name "virtio-input-host-pci", bus PCI, alias "virtio-input-host"

Actual results:
QEMU has removed the support for virtio-input-host-pci-{non-}transitional, but libvirt not.

Expected results:
Libvirt should also remove the support for 'virtio-input-host-pci-{non-}transitional model, and update the docs.

Additional info:
commit d923e30578a65392e50e530e3a29b2edf5c51c5b
Author: Gerd Hoffmann <kraxel>
Date:   Fri May 10 12:51:36 2019 +0200

    virtio-input-host-pci: cleanup types

    virtio input is virtio-1.0 only, so we don't need the -transitional and
    -non-transitional variants.

    Signed-off-by: Gerd Hoffmann <kraxel>

    Reviewed-by: Marc-André Lureau <marcandre.lureau>

Message-id: 20190510105137.17481-1-kraxel

Comment 5 Ján Tomko 2022-01-18 15:04:37 UTC
Upstream patches:
https://listman.redhat.com/archives/libvir-list/2022-January/msg00811.html

Comment 6 Ján Tomko 2022-01-18 18:16:58 UTC
commit ae8add363a54e30ebf1c71e8644fe626a5029c33
Author:     Ján Tomko <jtomko>
CommitDate: 2022-01-18 19:13:40 +0100

    qemu: remove support for transitional virtio-input-host
    
    virtio-input is virtio-1.0 only and these models have been only present
    in one upstream QEMU release, then removed by:
    
          commit d923e30578a65392e50e530e3a29b2edf5c51c5b
              virtio-input-host-pci: cleanup types
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1745868
    
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Andrea Bolognani <abologna>

git describe: v8.0.0-88-gae8add363a

Comment 7 Lili Zhu 2022-03-20 11:55:18 UTC
Tested with:
libvirt-8.2.0-1.fc35.x86_64

1.try to edit the guest xml with
<input type='passthrough' bus='virtio' model='virtio-transitional'>
      <source evdev='/dev/input/event1234/>
    </input>

# virsh edit avocado-vt-vm1 
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough
Failed. Try again? [y,n,i,f,?]: 

2. try to edit the guest xml with
<input type='passthrough' bus='virtio' model='virtio-non-transitional'>
      <source evdev='/dev/input/event1234/>
    </input>

# virsh edit avocado-vt-vm1 
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough
Failed. Try again? [y,n,i,f,?]:

Comment 10 Lili Zhu 2022-05-03 10:52:00 UTC
Verified this bug with:
libvirt-8.2.0-1.el9.x86_64

Scenario 1:
1.try to edit the guest xml with
<input type='passthrough' bus='virtio' model='virtio-transitional'>
      <source evdev='/dev/input/event1234/>
    </input>

# virsh edit avocado-vt-vm1 
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough
Failed. Try again? [y,n,i,f,?]: 

2. try to edit the guest xml with
<input type='passthrough' bus='virtio' model='virtio-non-transitional'>
      <source evdev='/dev/input/event1234/>
    </input>

# virsh edit avocado-vt-vm1 
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough
Failed. Try again? [y,n,i,f,?]:

Scenario 2:
3. prepare a guest with the following xml:
  </input>
        <input type='passthrough' bus='virtio' model='virtio-non-transitional'>
      <source evdev='/dev/input/event1234'/>
    </input>

4. define the guest
# virsh define avocado-vt-vm1.xml 
error: Failed to define domain from avocado-vt-vm1.xml
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough

5. prepare a guest with the following xml:
</input>
        <input type='passthrough' bus='virtio' model='virtio-transitional'>
      <source evdev='/dev/input/event1234'/>
    </input>

6. define the guest
# virsh define avocado-vt-vm1.xml 
error: Failed to define domain from avocado-vt-vm1.xml
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough

Scenario 3:
7. prepare a xml file:
# cat pass.xml
</input>
        <input type='passthrough' bus='virtio' model='virtio-transitional'>
      <source evdev='/dev/input/event1234'/>
    </input>

8. attach the xml to guest
# virsh attach-device avocado-vt-vm1 pass.xml 
error: Failed to attach device from pass.xml
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough

9. prepare a xml file:
# cat pass.xml
</input>
        <input type='passthrough' bus='virtio' model='virtio-non-transitional'>
      <source evdev='/dev/input/event1234'/>
    </input>

10. attach the xml to guest
# virsh attach-device avocado-vt-vm1 pass.xml 
error: Failed to attach device from pass.xml
error: unsupported configuration: virtio (non-)transitional models are not supported for input type=passthrough

As the test results match with the expected result, mark the bug as verified.

Comment 12 errata-xmlrpc 2022-11-15 10:03:03 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 (Low: libvirt security, 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/RHSA-2022:8003