aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-03 16:06:10 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-03 16:06:10 +0100
commit6ad3a86f1e485235becc1eb4d5a21d59fc5c5779 (patch)
tree7a4c30adb23d4c1b81550b9467c908c633d79be1
parent98f2574f7467c72fba8ab85664478f3a56ec4173 (diff)
downloadxen-6ad3a86f1e485235becc1eb4d5a21d59fc5c5779.tar.gz
xen-6ad3a86f1e485235becc1eb4d5a21d59fc5c5779.tar.bz2
xen-6ad3a86f1e485235becc1eb4d5a21d59fc5c5779.zip
tools: xend: tolerate empty state/*.xml
Bugzilla 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty which I get often when replacing the Xen hypervisor with a newer version. This can be easily be reproduced under Fedora Core 16 by installing xen RPMs and then replacing the xen.gz with a newer version. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Anthony Low <shinji@pikopiko.org> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> xen-unstable changeset: 24140:a3a2e300951a Backport-requested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/python/xen/xend/XendStateStore.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/python/xen/xend/XendStateStore.py b/tools/python/xen/xend/XendStateStore.py
index 74767260f8..17a29f180e 100644
--- a/tools/python/xen/xend/XendStateStore.py
+++ b/tools/python/xen/xend/XendStateStore.py
@@ -101,6 +101,9 @@ class XendStateStore:
if not os.path.exists(xml_path):
return {}
+ if not os.path.getsize(xml_path) == 0:
+ return {}
+
dom = minidom.parse(xml_path)
root = dom.documentElement
state = {}