[libvirt] [PATCH] Don't update dom->persistent without lock held
Daniel P. Berrange
berrange at redhat.com
Mon Oct 28 14:08:06 UTC 2013
From: "Daniel P. Berrange" <berrange at redhat.com>
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 at redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 562d98b..51c4e29 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);
}
}
--
1.8.3.1
More information about the libvir-list
mailing list