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 <berrange@redhat.com>
(cherry picked from commit b260a77e34ed93f1b4f4f6436435cf5955e3f4b8)
This commit is contained in:
Daniel P. Berrange 2013-10-28 14:07:26 +00:00 committed by Cole Robinson
parent 643f5fcf3a
commit 9311f8c6f3

View File

@ -17343,9 +17343,9 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
notify,
opaque);
if (dom) {
virObjectUnlock(dom);
if (!liveStatus)
dom->persistent = 1;
virObjectUnlock(dom);
}
}