mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-04 20:15:19 +00:00
qemu: Don't delete USB device on failed qemuPrepareHostdevUSBDevices
If qemuPrepareHostdevUSBDevices fail it will roll back devices added
to the driver list of used devices. However, if it may fail because
the device is being used already. But then again - with roll back.
Therefore don't try to remove a usb device manually if the function
fail. Although, we want to remove the device if any operation
performed afterwards fail.
(cherry picked from commit 9c484e3dc5
)
This commit is contained in:
parent
5b66c62d47
commit
e240feae95
@ -1173,8 +1173,10 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, list) < 0)
|
||||
if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, list) < 0) {
|
||||
usb = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
usbDeviceListSteal(list, usb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user