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.
Bug 723863 - usb: fixes various issues.
Summary: usb: fixes various issues.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-21 12:14 UTC by Gerd Hoffmann
Modified: 2013-01-10 00:07 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.179.el6
Doc Type: Bug Fix
Doc Text:
Bug wasn't present in any released version.
Clone Of:
Environment:
Last Closed: 2011-12-06 15:54:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1531 0 normal SHIPPED_LIVE Moderate: qemu-kvm security, bug fix, and enhancement update 2011-12-06 01:23:30 UTC

Description Gerd Hoffmann 2011-07-21 12:14:58 UTC
Description of problem:
A bunch of issues have been found during the review of the huge
usb 2.0 patch series for qemu-kvm.  Fixes for many of them have
been comitted upstream and should be backported.

Comment 6 Shaolong Hu 2011-09-01 10:50:14 UTC
Hi Gerd,

Reviewing this patch set, i would like to classify them into three parts:
1) Companion controller related patches
2) Patches that can be tested through regular operation of qemu-kvm, like:
   usb-bus: Don't allow attaching a device to a bus with no free ports
   usb: Proper error propagation for usb_device_attach errors
3) Patches that can not be tested through regular operation of qemu-kvm, like:
   ehci: add freq + maxframes properties


For
patches in 1), have been verified in Bug 723858 usb: add companion controller support.
patches in 3), verify they are patched in the latest version, if you want me do more tests, please tell me the patch and method.


Try to verify following patches on qemu-kvm-0.12.1.2-2.184.el6.x86_64:
----------------------------------------------------------------------
usb-bus: Don't allow attaching a device to a bus with no free ports
usb: Proper error propagation for usb_device_attach errors


Steps and results:
-------------------
1.Boot guest with:
# /usr/libexec/qemu-kvm -enable-kvm -M rhel6.2.0 -smp 4 -m 4G -name rhel6.1-64 -uuid 3f2ea5cd-3d29-48ff-aab2-23df1b6ae213 -drive file=RHEL-Server-6.1-64-virtio.qcow2,cache=none,if=none,rerror=stop,werror=stop,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=device-virtio-disk0,bootindex=1 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -boot order=cd,menu=on -monitor stdio -vnc :30 -usb
QEMU 0.12.1 monitor - type 'help' for more information

2.In qemu monitor:

(qemu) device_add usb-tablet,port=1,id=input1
(qemu) device_add usb-tablet,port=2,id=input2
(qemu) device_add usb-tablet,id=input3
Error: tried to attach usb device QEMU USB Tablet to a bus with no free ports

Device 'usb-tablet' could not be initialized

(qemu) device_add usb-hub,id=usbhub1
(qemu) info usb
  Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 0.3, Port 2, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 0.0, Port .1, Speed 12 Mb/s, Product QEMU USB Hub
(qemu) info qtree
      dev: piix3-usb-uhci, id ""
        dev-prop: masterbus = <null>
        dev-prop: firstport = 0
        bus-prop: addr = 01.2
        bus-prop: romfile = <null>
        bus-prop: rombar = 1
        bus-prop: multifunction = off
        class USB controller, addr 00:01.2, pci id 8086:7020 (sub 1af4:1100)
        bar 4: i/o at 0xc020 [0xc03f]
        bus: usb.0
          type USB
          dev: usb-hub, id "usbhub1"
            bus-prop: port = <null>
            addr 0.0, port .1, speed 12, name QEMU USB Hub, attached
          dev: usb-tablet, id "input2"
            dev-prop: migrate = 1
            bus-prop: port = "2"
            addr 0.3, port 2, speed 12, name QEMU USB Tablet, attached
          dev: usb-tablet, id "input1"
            dev-prop: migrate = 1
            bus-prop: port = "1"
            addr 0.2, port 1, speed 12, name QEMU USB Tablet, attached

3.In patch: Proper error propagation for usb_device_attach errors, there are several errors:

1) error_report("%s: no bus specified, using \"%s\" for \"%s\"\n", __FUNCTION__, bus->qbus.name, name);
2) error_report("Error: tried to attach usb device %s twice\n", dev->product_desc);
3) error_report("Error: tried to attach usb device %s to a bus with no free ports\n", dev->product_desc)
4) error_report("Error: usb port %s (bus %s) not found\n", dev->port_path, bus->qbus.name);
5) error_report("Error: tried to detach unattached usb device %s\n", dev->product_desc)

In usb device functional test we are running, we occur error 3 and 4, but never 1,2,5, could you please tell us the method to meet these errors? We may need to add cases according to this.


Conclusion:
--------------
Problem in step 2 is probably the same or related with these two new bugs, i recommend you have a look:

Bug 735009 Qemu-kvm fails to prompt error when add usb-hub to a non-exist uhci port and qemu-kvm hangs when delete this usb-hub

and 

Bug 734995 Core dump when hotplug three usb-hub into the same port under both uhci and ehci


Currently i would like to set this patch set verified if:
1) the two bugs above are effective and fixed or they are not bugs.
2) verify the error 1,2,5 mentioned above
3) there is no more tests you want me to do with this patch set


Any advice? Thanks.

Comment 7 Gerd Hoffmann 2011-09-01 13:18:21 UTC
If you manage to make errors (2)+(5) show up you have found a bug in qemu.  It doesn't make that much sense to report them to the user, in fact I've just converted them to assert() in upstream qemu.

Error (1) seems to not trigger any more, at least the way which used to work for me doesn't work any more.  Looks like the error condition is catched and handled elsewhere now.

734995 is a real bug, busy fixing that one right now.
735009 is a duplicate.

Comment 8 Shaolong Hu 2011-09-02 02:22:56 UTC
Thanks Gerd, i will set this bug verified after 734995 fixed.

Comment 9 Shaolong Hu 2011-10-09 09:42:48 UTC
According to:
https://bugzilla.redhat.com/show_bug.cgi?id=734995#c11

This bug has been fixed.

Comment 11 Gerd Hoffmann 2011-11-18 16:26:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Bug wasn't present in any released version.

Comment 12 errata-xmlrpc 2011-12-06 15:54:09 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2011-1531.html


Note You need to log in before you can comment on or make changes to this bug.