[libvirt] PATCH: Fix deadlock upon config file reload

Daniel P. Berrange berrange at redhat.com
Mon Dec 15 11:02:23 UTC 2008


Turned out there was a small locking bug when reloading domain config
files after SIGHUP. I committed the following patch to add in the missing
unlock call. This was one of the files I'm unable to do static analysis
on, hence why it was missed.

Daniel

Index: domain_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/domain_conf.c,v
retrieving revision 1.45
diff -u -p -r1.45 domain_conf.c
--- domain_conf.c	11 Dec 2008 11:44:30 -0000	1.45
+++ domain_conf.c	15 Dec 2008 10:51:11 -0000
@@ -3330,8 +3330,11 @@ virDomainObjPtr virDomainLoadConfig(virC
                                       VIR_DOMAIN_XML_INACTIVE)))
         goto error;
 
-    if (virDomainFindByName(doms, def->name))
+    if ((dom = virDomainFindByName(doms, def->name))) {
+        virDomainObjUnlock(dom);
+        dom = NULL;
         newVM = 0;
+    }
 
     if (!(dom = virDomainAssignDef(conn, doms, def)))
         goto error;

-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list