failure when detaching a usb device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Fedora) |
Fix Released
|
Medium
|
|||
libvirt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Raring |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
=======
SRU Justification:
1. Impact: usb device autoremoval is broken
2. Development fix: fix a typo in a matching function
3. Stable fix: backport of stable fix
4. Test case: virsh detach-device (see below)
5. Regression potential: this is a trivial cherrypick of upstream patch, so there should be little risk of regression
=======
Ubuntu 13.04
libvirt0: 1.0.2-0ubuntu11
The automatic unplugging of usb devices (in this case a Lego NXT) doesn't work any more. The following udev rule is used;
ACTION=="remove", \
SUBSYSTEMS=
ATTRS{
ATTRS{
RUN+
ACTION=="add", \
SUBSYSTEMS=
ATTRS{
ATTRS{
RUN+
the reason is apparently a bug in 'virsh detach-device':
$ /usr/bin/virsh attach-device WinXP-clone /var/lib/
Device attached successfully
$ /usr/bin/virsh detach-device WinXP-clone /var/lib/
Fehler: Fehler beim Lösen des Geräts von /var/lib/
Fehler: operation failed: host usb device vendor=0x0694 product=0x0002 not found
$ cat /var/lib/
<!--NXT -->
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0694'/>
<product id='0x0002'/>
</source>
</hostdev>
A fix might be described in RH bug# 916837:
---
src/conf/
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/
index 4cae0d3..2b2f35c 100644
--- a/src/conf/
+++ b/src/conf/
@@ -8541,7 +8541,7 @@ static int
virDomainHostd
{
- if (b->source.
+ if (a->source.
/* specified by bus location on host */
if (a->source.
--
1.7.11.2
description: | updated |
Changed in libvirt (Fedora): | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Description:
detach-device can't remove usb device when using xml file
Versions 1.0.2-1. el7.x86_ 64
libvirt-
How reproducible:
100%
Steps:
1:
#cat usb.xml
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0951'/>
<product id='0x1625'/>
</source>
</hostdev>
2: attach usb dev to guest
#virsh attach-device $guest usb.xml
Device attached successfully
3: detach usb dev from guest
#virsh detach-device $guest usb.xml
error: Failed to detach device from usb2.xml
error: operation failed: host usb device vendor=0x0951 product=0x1625 not found
Expect result
Device detached successfully
Additional info:
this worked on rhel6.4.
If add <address bus='1' device='2'/> in usb.xml , can detach usb successful.