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

Re: [libvirt] [PATCH 1/2] conf: Fix race between looking up a domain object and freeing it



On 04/09/2013 03:02 PM, Peter Krempa wrote:
  1 file changed, 4 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 03e5740..cafef0c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2238,10 +2238,14 @@ void virDomainObjListRemove(virDomainObjListPtr doms,
      char uuidstr[VIR_UUID_STRING_BUFLEN];

      virUUIDFormat(dom->def->uuid, uuidstr);
+    virObjectRef(dom);
      virObjectUnlock(dom);

      virObjectLock(doms);
+    virObjectLock(dom);
      virHashRemoveEntry(doms->objs, uuidstr);
+    virObjectUnlock(dom);
+    virObjectUnref(dom);
      virObjectUnlock(doms);
  }

+1, small fix big impact...

--

Mit freundlichen Grüßen/Kind Regards
   Viktor Mihajlovski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


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