xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty
@ 2011-11-03 16:04 Konrad Rzeszutek Wilk
  2011-11-14 17:55 ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-11-03 16:04 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson, Ian.Campbell, m.a.young

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1320336164 14400
# Node ID 76391f599433544ecf3f606e9d4997967d5d6cd4
# Parent  54a5e994a241a506900ee0e197bb42e5f1d8e759
BZ 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.

/var/log/xen/xend.log reports:

[2011-11-03 09:45:55 1368] ERROR (SrvDaemon:356) Exception starting xend (no element found: line 1, column 0)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xen/xend/server/SrvDaemon.py", line 348, in run
    servers = SrvServer.create()
  File "/usr/lib64/python2.7/site-packages/xen/xend/server/SrvServer.py", line 258, in create
    root.putChild('xend', SrvRoot())
  File "/usr/lib64/python2.7/site-packages/xen/xend/server/SrvRoot.py", line 40, in __init__
    self.get(name)
  File "/usr/lib64/python2.7/site-packages/xen/web/SrvDir.py", line 84, in get
    val = val.getobj()
  File "/usr/lib64/python2.7/site-packages/xen/web/SrvDir.py", line 52, in getobj
    self.obj = klassobj()
  File "/usr/lib64/python2.7/site-packages/xen/xend/server/SrvNode.py", line 30, in __init__
    self.xn = XendNode.instance()
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendNode.py", line 1181, in instance
    inst = XendNode()
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendNode.py", line 71, in __init__
    saved_host = self.state_store.load_state('host')
  File "/usr/lib64/python2.7/site-packages/xen/xend/XendStateStore.py", line 104, in load_state
    dom = minidom.parse(xml_path)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/dom/minidom.py", line 1915, in parse
    return expatbuilder.parse(file)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/dom/expatbuilder.py", line 926, in parse
    result = builder.parseFile(fp)
  File "/usr/lib64/python2.7/site-packages/_xmlplus/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
ExpatError: no element found: line 1, column 0

And with this patch, the problem disappears

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Anthony Low <shinji@pikopiko.org>

diff -r 54a5e994a241 -r 76391f599433 tools/python/xen/xend/XendStateStore.py
--- a/tools/python/xen/xend/XendStateStore.py	Wed Nov 02 17:09:09 2011 +0000
+++ b/tools/python/xen/xend/XendStateStore.py	Thu Nov 03 12:02:44 2011 -0400
@@ -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 = {}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty
  2011-11-03 16:04 [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty Konrad Rzeszutek Wilk
@ 2011-11-14 17:55 ` Ian Jackson
  2011-11-14 18:02   ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2011-11-14 17:55 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Ian.Campbell, m.a.young

Konrad Rzeszutek Wilk writes ("[Xen-devel] [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty"):
> BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty

We're not really maintaining xend any more but this change is at the
very worst harmless and I have applied it.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty
  2011-11-14 17:55 ` Ian Jackson
@ 2011-11-14 18:02   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-11-14 18:02 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Ian.Campbell, m.a.young

On Mon, Nov 14, 2011 at 05:55:25PM +0000, Ian Jackson wrote:
> Konrad Rzeszutek Wilk writes ("[Xen-devel] [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty"):
> > BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty
> 
> We're not really maintaining xend any more but this change is at the
> very worst harmless and I have applied it.

Thanks Ian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-14 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 16:04 [PATCH] BZ 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty Konrad Rzeszutek Wilk
2011-11-14 17:55 ` Ian Jackson
2011-11-14 18:02   ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).