[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools: xend: tolerate empty state/*.xml



# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
# Date 1321293294 0
# Node ID a3a2e300951a7d181ae825b5de408faa889928c6
# Parent  39bc21b5060b843dc3b1f081c337662efcf0d35a
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@xxxxxxxxxx>
Signed-off-by: Anthony Low <shinji@xxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 39bc21b5060b -r a3a2e300951a tools/python/xen/xend/XendStateStore.py
--- a/tools/python/xen/xend/XendStateStore.py   Mon Nov 14 17:50:53 2011 +0000
+++ b/tools/python/xen/xend/XendStateStore.py   Mon Nov 14 17:54:54 2011 +0000
@@ -101,6 +101,9 @@
         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 = {}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.