]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: fix a failure when detaching a usb device
authorGuannan Ren <gren@redhat.com>
Tue, 26 Mar 2013 14:17:43 +0000 (22:17 +0800)
committerGuannan Ren <gren@redhat.com>
Wed, 27 Mar 2013 02:38:08 +0000 (10:38 +0800)
commita950f03e16dd958f821027aa5d396166163c3200
tree6568bbc9e94889864f92cc1712a6a95776a9487d
parent4faf435cbdd59ab09c69bfa47fd3c97395dca316
conf: fix a failure when detaching a usb device

 #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

This regresstion is due to a typo in matching function. The first
argument is always the usb device that we are checking for. If the
usb xml file provided by user contains bus and device info, we try
to search it by them, otherwise, we use vendor and product info.

The bug occurred only when detaching a usb device with no bus and
device info provided in the usb xml file.
src/conf/domain_conf.c