Bug 769745 - Released usb stick after passthrough fails to be reused on host
Summary: Released usb stick after passthrough fails to be reused on host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-22 03:23 UTC by Shaolong Hu
Modified: 2013-01-10 00:38 UTC (History)
11 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.222.el6
Doc Type: Bug Fix
Doc Text:
Cause: USB release function was not called in the exit notifier Consequence: Host was unable to reuse USB device after it has been removed from the guest. Fix: Call release function in the exit notifier too. Result: Host still can reuse the USB device after removal from the guest.
Clone Of:
Environment:
Last Closed: 2012-06-20 11:38:05 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0746 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2012-06-19 19:31:48 UTC

Description Shaolong Hu 2011-12-22 03:23:09 UTC
Description of problem:
------------------------
Released usb stick after passthrough fails to be reused on host, according to test plan, this is not correct:

[passthrough] Release the physical USB stick/webcam from guest, check if it works well on host
Remove USB stick/webcam from guest.
Verify USB stick/webcam works correctly on host, no errors found in console of host, dmesg output of host. 

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
qemu-kvm-0.12.1.2-2.213.el6.x86_64

How reproducible:
-------------------
100%

Steps to Reproduce:
--------------------
1.boot guest with "-readconfig ich9-ehci-uhci.cfg"
2.in qemu monitor, passthrough host usb stick to guest
3.in qemu monitor, delete the usb stick
  
Actual results:
-----------------
After step 3, on host:
1. lsusb can show the usb stick
2. fdisk -l fails to show the usb stick
3. ls /dev/sd* fails to show the stick

Expected results:
------------------
The best: Usb stick can be used on host automatically.
Workaround: Some manual configuration, like pci device passthrough, and if this is feasible, better qemu-kvm does it automatically.
Currently: Re-plug the stick.

Comment 1 Gerd Hoffmann 2012-01-04 11:54:13 UTC
What monitor commands do you issue for steps (2) + (3) ?

Comment 2 Shaolong Hu 2012-01-05 02:31:54 UTC
(In reply to comment #1)
> What monitor commands do you issue for steps (2) + (3) ?

2.(qemu)device_add usb-host,hostbus=X,hostaddr=X,id=hostusb1
3.(qemu)device_del hostusb1

Comment 4 Shaolong Hu 2012-02-09 02:58:02 UTC
Verified on qemu-kvm-0.12.1.2-2.223.el6.x86_64:

With steps in Description:

After step 3, on host:
1. lsusb shows the usb stick
2. fdisk -l shows the usb stick
3. ls /dev/sd* shows the usb stick
4. mount /dev/sdb1 /mnt, the usb stick can be used correctly

Verified.

Comment 6 Michal Novotny 2012-05-04 09:37:35 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:
Cause:
USB release function was not called in the exit notifier

Consequence:
Host was unable to reuse USB device after it has been removed from the guest.

Fix:
Call release function in the exit notifier too.

Result:
Host still can reuse the USB device after removal from the guest.

Comment 7 errata-xmlrpc 2012-06-20 11:38:05 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/RHBA-2012-0746.html


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