Bug 806449 - USB 2.0 pass-through won't boot guest VM a SECOND time.
USB 2.0 pass-through won't boot guest VM a SECOND time.
Status: CLOSED NEXTRELEASE
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Michal Privoznik
:
Depends On:
Blocks: 808459
  Show dependency treegraph
 
Reported: 2012-03-23 15:05 EDT by Matt Piermarini
Modified: 2012-04-05 10:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 808459 (view as bug list)
Environment:
Last Closed: 2012-04-05 10:11:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Piermarini 2012-03-23 15:05:47 EDT
Description of problem:

Using the new USB 2.0 pass-through feature with a standard USB memory stick, the initial guest boot (qemu-kvm) works great.   If you shutdown the guest, and then try to restart the guest, you will get an error like:


Error starting domain: Requested operation is not valid: USB device 002:004 is in use by domain "tus=0 serial=566\Uffffffff"

Note that the string in quotes is always some garbage.

If I restart libvirtd, I can then start the guest properly.


Version-Release number of selected component (if applicable):


libvirt GIT from 2012-03-23

How reproducible:

Create a linux VM using virt-manager.
Set Controller USB to 2.0
Add a USB Host device, any memory stick will do.
startup guest
shutdown guest
startup guest


Steps to Reproduce:
1.
2.
3.
  
Actual results:

Error saying USB device is in use by domain "XXXX"

Expected results:

Guest VM should start

Additional info:

Tried on Fedora 16, openSuse 12.1, archlinux, all with same results.
Comment 6 Matt Piermarini 2012-04-05 09:37:43 EDT
FYI,

I recently pulled libvirt-git (2012-04-04) and the USB 2.0 pass-through is now working when the VM is re-started.  This can now be closed.
Comment 7 Michal Privoznik 2012-04-05 10:11:04 EDT
Yes, the patches have been committed upstream:

commit ea3bc548aca7b4c448b48863120ad35a7337c127
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Mar 26 16:44:19 2012 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Apr 4 15:09:41 2012 +0200

    qemu: Build activeUsbHostdevs list on process reconnect
    
    If the daemon is restarted it will lose list of active
    USB devices assigned to active domains. Therefore we need
    to rebuild this list on qemuProcessReconnect().

commit e2f5dd6134ebeb6846450c7d7782273d3d274859
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Mar 26 16:40:01 2012 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Apr 4 15:09:41 2012 +0200

    qemu: Delete USB devices used by domain on stop
    
    To prevent assigning one USB device to two domains,
    we keep a list of assigned USB devices. On domain
    startup - qemuProcessStart() - we insert devices
    used by domain into the list but remove them only
    on detach-device. Devices are, however, released
    on qemuProcessStop() as well.

commit b2c7b9ee0e6f2203984035668c066be37f3a256a
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Mar 26 16:33:58 2012 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Apr 4 15:09:41 2012 +0200

    qemu: Don't leak temporary list of USB devices
    
    and add debug message when adding USB device
    to the list of active devices.

Those patches will be part of next release. Therefore I am closing this as NEXTRELEASE.

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