mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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);
|
||||
VIR_WITH_OBJECT_LOCK_GUARD(hostdev_mgr->activeUSBHostdevs) {
|
||||
virUSBDeviceListDel(hostdev_mgr->activeUSBHostdevs, usb);
|
||||
virObjectUnlock(hostdev_mgr->activeUSBHostdevs);
|
||||
}
|
||||
|
||||
virDomainHostdevRemove(vm->def, idx);
|
||||
virDomainHostdevDefFree(def);
|
||||
|
Loading…
x
Reference in New Issue
Block a user