** Description changed:
+ ===================================
+ 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.13.04.2
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=="usb", \
ATTRS{idVendor}=="0694", \
ATTRS{idProduct}=="0002", \
RUN+="/usr/bin/virsh detach-device WinXP-clone
/var/lib/libvirt/images/hostdev-0694:0002.xml"
ACTION=="add", \
SUBSYSTEMS=="usb", \
ATTRS{idVendor}=="0694", \
ATTRS{idProduct}=="0002", \
RUN+="/usr/bin/virsh attach-device WinXP-clone
/var/lib/libvirt/images/hostdev-0694:0002.xml"
the reason is apparently a bug in 'virsh detach-device':
$ /usr/bin/virsh attach-device WinXP-clone
/var/lib/libvirt/images/hostdev-0694:0002.xml
Device attached successfully
$ /usr/bin/virsh detach-device WinXP-clone
/var/lib/libvirt/images/hostdev-0694:0002.xml
Fehler: Fehler beim Lösen des Geräts von
/var/lib/libvirt/images/hostdev-0694:0002.xml
Fehler: operation failed: host usb device vendor=0x0694 product=0x0002 not
found
$ cat /var/lib/libvirt/images/hostdev-0694:0002.xml
<!--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/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4cae0d3..2b2f35c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8541,7 +8541,7 @@ static int
virDomainHostdevMatchSubsysUSB(virDomainHostdevDefPtr a,
virDomainHostdevDefPtr b)
{
- if (b->source.subsys.u.usb.bus && b->source.subsys.u.usb.device) {
+ if (a->source.subsys.u.usb.bus && a->source.subsys.u.usb.device) {
/* specified by bus location on host */
if (a->source.subsys.u.usb.bus == b->source.subsys.u.usb.bus &&
a->source.subsys.u.usb.device == b->source.subsys.u.usb.device)
--
1.7.11.2
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1219435
Title:
failure when detaching a usb device
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1219435/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs