xcp-1.6-updates/xen-4.1.hg

changeset 23275:369bf6c946b9

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>
author Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
date Tue Apr 03 16:06:10 2012 +0100 (2012-04-03)
parents 98dbb195d270
children 6f224431eca2
files tools/python/xen/xend/XendStateStore.py
line diff
     1.1 --- a/tools/python/xen/xend/XendStateStore.py	Tue Apr 03 16:03:47 2012 +0100
     1.2 +++ b/tools/python/xen/xend/XendStateStore.py	Tue Apr 03 16:06:10 2012 +0100
     1.3 @@ -101,6 +101,9 @@ class XendStateStore:
     1.4          if not os.path.exists(xml_path):
     1.5              return {}
     1.6  
     1.7 +        if not os.path.getsize(xml_path) == 0:
     1.8 +            return {}
     1.9 +
    1.10          dom = minidom.parse(xml_path)
    1.11          root = dom.documentElement
    1.12          state = {}