]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't update dom->persistent without lock held
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 28 Oct 2013 14:07:26 +0000 (14:07 +0000)
committerCole Robinson <crobinso@redhat.com>
Wed, 6 Nov 2013 16:44:49 +0000 (11:44 -0500)
virDomainObjListLoadAllConfigs sets dom->persistent after
having released its lock on the domain object. This exposes
a possible race condition.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit b260a77e34ed93f1b4f4f6436435cf5955e3f4b8)

src/conf/domain_conf.c

index c51cd11b9d9c17b25edcf387354d00c72d3beee6..53889e0e04a7b7c893e20542e3d7713506b9703c 100644 (file)
@@ -17343,9 +17343,9 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
                                              notify,
                                              opaque);
         if (dom) {
-            virObjectUnlock(dom);
             if (!liveStatus)
                 dom->persistent = 1;
+            virObjectUnlock(dom);
         }
     }