[libvirt] [PATCH 04/14] secret: Have virSecretObjNew return locked object

John Ferlan jferlan at redhat.com
Mon Apr 24 18:00:13 UTC 2017


Rather than have caller need to do it, have the object returned locked.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/virsecretobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 064e66c..348feb3 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -97,6 +97,8 @@ virSecretObjNew(void)
     if (!(secret = virObjectLockableNew(virSecretObjClass)))
         return NULL;
 
+    virObjectLock(secret);
+
     return secret;
 }
 
@@ -367,8 +369,6 @@ virSecretObjListAddLocked(virSecretObjListPtr secrets,
         if (!(secret = virSecretObjNew()))
             goto cleanup;
 
-        virObjectLock(secret);
-
         if (virHashAddEntry(secrets->objs, uuidstr, secret) < 0)
             goto cleanup;
 
-- 
2.9.3




More information about the libvir-list mailing list