[libvirt PATCH 03/10] node_device_driver: Use automatic mutex management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 130c1d4023..1eb452b989 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1072,14 +1072,10 @@ static bool
 matchDeviceAddress(virNodeDeviceObj *obj,
                    const void *opaque)
 {
-    g_autofree char *addr = NULL;
-    bool want = false;
-
-    virObjectLock(obj);
-    addr = nodeDeviceObjFormatAddress(obj);
-    want = STREQ_NULLABLE(addr, opaque);
-    virObjectUnlock(obj);
-    return want;
+    VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+    g_autofree char *addr = nodeDeviceObjFormatAddress(obj);
+
+    return STREQ_NULLABLE(addr, opaque);
 }
 
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux