diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-11-14 17:54:54 +0000 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-11-14 17:54:54 +0000 |
commit | e8d40584e5e2e6cf50db12674547f8a9e3177a10 (patch) | |
tree | 575b33dfb32ca25db13eb20ab7cf0595b19dbeaf /tools/python | |
parent | d0de523f12adc346fc427ba35ba1c31ef4896114 (diff) | |
download | xen-e8d40584e5e2e6cf50db12674547f8a9e3177a10.tar.gz xen-e8d40584e5e2e6cf50db12674547f8a9e3177a10.tar.bz2 xen-e8d40584e5e2e6cf50db12674547f8a9e3177a10.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>
Diffstat (limited to 'tools/python')
-rw-r--r-- | tools/python/xen/xend/XendStateStore.py | 3 |
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 = {} |