mirror of https://gitee.com/openkylin/libvirt.git
lxcDomainDetachDeviceHostdevUSBLive: Use VIR_WITH_OBJECT_LOCK_GUARD
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
03f9f50712
commit
28e9877e86
|
@ -4045,9 +4045,9 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriver *driver,
|
|||
VIR_WARN("cannot deny device %s for domain %s: %s",
|
||||
dst, vm->def->name, virGetLastErrorMessage());
|
||||
|
||||
virObjectLock(hostdev_mgr->activeUSBHostdevs);
|
||||
virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb);
|
||||
virObjectUnlock(hostdev_mgr->activeUSBHostdevs);
|
||||
VIR_WITH_OBJECT_LOCK_GUARD(hostdev_mgr->activeUSBHostdevs) {
|
||||
virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb);
|
||||
}
|
||||
|
||||
virDomainHostdevRemove(vm->def, idx);
|
||||
virDomainHostdevDefFree(def);
|
||||
|
|
Loading…
Reference in New Issue