Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/lxc/lxc_driver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index e2720a6f89..528af5d164 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4079,9 +4079,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);
--
2.31.1