mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: hotplug: Fix adding USB devices to the driver list
We were unconditionally removing the device from the host list, when it should only be done on error. This fixes USB collision detection when hotplugging the same device to two guests. (cherry picked from commit 586b0ed81828a443717b018989f2bced1bcfac01)
This commit is contained in:
parent
4891858730
commit
acc55b6728
@ -1498,9 +1498,9 @@ cleanup:
|
||||
virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
||||
vm->def, hostdev, NULL) < 0)
|
||||
VIR_WARN("Unable to restore host device labelling on hotplug fail");
|
||||
if (added)
|
||||
virUSBDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
}
|
||||
if (added)
|
||||
virUSBDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
if (list && usb &&
|
||||
!virUSBDeviceListFind(list, usb) &&
|
||||
!virUSBDeviceListFind(driver->activeUsbHostdevs, usb))
|
||||
|
Loading…
x
Reference in New Issue
Block a user