Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1926063[details]
the VM XML, logs of usbredirserver, virtqemud and qemu
Description of problem:
As subject
Version-Release number of selected component (if applicable):
libvirt-8.9.0-2.el9.x86_64
qemu-kvm-7.1.0-5.el9.x86_64
usbredir-0.12.0-3.el9.x86_64
libusbx-1.0.26-1.el9.x86_64
guest kernel: kernel-5.14.0-197.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Prepare a host with a USB mass storage:
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
/sys/bus/usb/devices/usb2 /dev/bus/usb/002/001
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
ID 8087:8002 Intel Corp. 8 channel internal hub
/sys/bus/usb/devices/2-1 /dev/bus/usb/002/002
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
/sys/bus/usb/devices/usb1 /dev/bus/usb/001/001
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
ID 8087:800a Intel Corp. Hub
/sys/bus/usb/devices/1-1 /dev/bus/usb/001/002
|__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ID 0781:5591 SanDisk Corp. Ultra Flair
/sys/bus/usb/devices/1-1.1 /dev/bus/usb/001/003
|__ Port 6: Dev 4, If 0, Class=Hub, Driver=hub/6p, 480M
ID 413c:a001 Dell Computer Corp. Hub
/sys/bus/usb/devices/1-1.6 /dev/bus/usb/001/004
2. Start the usbredirserver to share the mass storage:
# LIBUSB_DEBUG=4 usbredirserver -v5 -p 6000 1-3
3. Start a VM with a USB redirdev connected. VM XML:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<redirdev bus="usb" type="tcp">
<source mode="connect" host="localhost4" service="6000" tls="no"/>
<protocol type="raw"/>
<alias name="ua-REDIR"/>
<address type="usb" bus="0" port="1"/>
</redirdev>
...
<qemu:commandline>
<qemu:env name='LIBUSB_DEBUG' value='4'/>
</qemu:commandline>
</domain>
# virsh create vm.xml
Domain 'avocado-vt-vm1' created from vm.xml
4. Login to the VM, check the usb mass storage:
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
No such a device.
Actual results:
As above
Expected results:
The usbredir device should be in the VM.
Additional info:
I.
The hmp query for usb and chardev look well:
# virsh qemu-monitor-command avocado-vt-vm1 --hmp info usb
Device 0.0, Port 1, Speed 1.5 Mb/s, Product USB Redirection Device, ID: ua-REDIR
# virsh qemu-monitor-command avocado-vt-vm1 --hmp info chardev
charua-REDIR: filename=tcp:127.0.0.1:47770 <-> 127.0.0.1:6000
charserial0: filename=pty:/dev/pts/8
charmonitor: filename=unix:/var/lib/libvirt/qemu/domain-1-avocado-vt-vm1/monitor.sock,server=on
II.
And it works for hot-plug:
1. Start a VM without redirdev
2. Hot-plug the redirdev after guest is booted:
# virsh attach-device avocado-vt-vm1 redirdev.xml
Device attached successfully
Check usb disk in guest:
(guest)# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0781:5591 SanDisk Corp. Ultra Flair
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
III.
Reproduced with the manual set qemu cmdline with debugging options **debug=4**:
<qemu:commandline>
<qemu:env name='LIBUSB_DEBUG' value='4'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='socket,id=charua-REDIR,host=localhost4,port=6000,debug=4'/>
<qemu:arg value='-device'/>
<qemu:arg value='{"driver":"usb-redir","chardev":"charua-REDIR","id":"ua-REDIR","bus":"usb.0","port":"1","debug":4}'/>
</qemu:commandline>
IV.
The attachment:
redir-libvirt/ : the VM XML, logs of usbredirserver, virtqemud and qemu from the steps of bugs
redir-hotplug: the VM XML, redirdev XML, logs of usbredirserver, virtqemud and qemu from II
redir-qemu/ : the VM XML, logs of usbredirserver, virtqemud and qemu from III
V.
It works on:
libvirt libvirt-8.9.0-2.el9.x86_64
qemu-kvm qemu-kvm-7.1.0-4.el9.x86_64
kernel kernel-5.14.0-188.el9.x86_64
qemu-kvm-rhev not installed
selinux-policy selinux-policy-34.1.46-1.el9.noarch
spice-gtk not installed
spice not installed
libcgroup not installed
systemd systemd-250-12.el9_1.x86_64
netcf not installed
dnsmasq dnsmasq-2.85-5.el9.x86_64
virtio-win not installed
Covered by tp-libvirt usb_device.redirdev.tcp.usb2_0.companion.pcie-root.pcie-root-port.pcie-to-pci-bridge
I have bisected this to QEMU commit:
commit 0631d4b448454ae8a1ab091c447e3f71ab6e088a
usbredir: avoid queuing hello packet on snapshot restore
git describe: v7.0.0-1841-g0631d4b448 contains: v7.1.0-rc0~63^2~4
A revert has been proposed by the author but was not merged:
https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg02068.html
(In reply to John Ferlan from comment #4)
> Gerd - should/can the patch from above that Jano reviewed get merged before
> qemu-7.2 so it can be included into RHEL 9.2?
Looking ....
Hmm, it's actually part of a three patch series, where patch #2 introduces
a new runstate. I don't think that kind of change is a good idea during
7.2 release freeze.
The rest of the series is irrelevant. It implements a workaround that is no longer needed.
Patch 1/3 reverts the original workaround, which broke usbredir with libvirt.
Would it be helpful if I resent the patch separately?
Reproduced with following components:
5.14.0-200.el9.x86_64
qemu-kvm-7.1.0-5.el9.x86_64
usbredir-0.12.0-3.el9.x86_64
usbredir-server-0.12.0-3.el9.x86_64
libusbx-1.0.26-1.el9.x86_64
usb.usb_redir.via_tcp
The upstream patch is merged and will be present in qemu-7.2, adjusting other fields (ITR, DTM, depends on bug, State, DevelWhiteboard, devel_ack)... Dropping the needinfo - thanks Gerd for getting this in!
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 (Moderate: qemu-kvm 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-2023:2162