mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
98f2574f74
commit
6ad3a86f1e
1 file changed
+3
@@ -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 = {}
|
||||
|
||||