From: Daniel P. Berrange Date: Mon, 28 Oct 2013 14:07:26 +0000 (+0000) Subject: Don't update dom->persistent without lock held X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b260a77e34ed93f1b4f4f6436435cf5955e3f4b8;p=libvirt.git Don't update dom->persistent without lock held 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 --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 562d98b032..51c4e29ba7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17373,9 +17373,9 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms, notify, opaque); if (dom) { - virObjectUnlock(dom); if (!liveStatus) dom->persistent = 1; + virObjectUnlock(dom); } }