WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] PATCH: Ignore errors from dieing domains in RPC server

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] PATCH: Ignore errors from dieing domains in RPC server
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Fri, 11 Jul 2008 12:32:50 +0100
Delivery-date: Fri, 11 Jul 2008 04:33:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
When a domain is in the process of shutting down there is a small window
when the domain is known to XenD, but it will be unable to form an SXPR
for it due it being in the middle of device hot-unplug. This causes the
'xm list' command to totally fail with an error like

# xm list
Error: Device 0 not connected
Usage: xm list [options] [Domain, ...]

List information about all/some domains.
  -l, --long                     Output all VM details in SXP
  --label                        Include security labels


The 'xm list' command calls into the 'domains' method of XMLRPCServer.py
in XenD. This method just iterates over the list of domains, fetching
the sxpr for each in turn, but with no exception handling. So if a single
domain fails to generate an sxpr, no data is returned even for other
domains which are still functional.  This patch simply makes XenD ignore
and skip over domains which throw an exception, logging the problematic
domain.

NB, this problem only hits 'xm list' if it is configured to use the legay
XMLRPC server instead of XenAPI.

   Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

diff -r 27aaff984b36 tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Thu Jul 10 17:33:23 
2008 +0100
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Fri Jul 11 12:28:02 
2008 +0100
@@ -64,7 +64,14 @@
 def domains_with_state(detail, state, full):
     if detail:
         domains = XendDomain.instance().list_sorted(state)
-        return map(lambda dom: fixup_sxpr(dom.sxpr(not full)), domains)
+        ret = []
+        for dom in domains:
+            try:
+                ret.append(fixup_sxpr(dom.sxpr(not full)))
+            except:
+                log.warn("Failed to query SXPR for domain %s" % str(dom))
+                pass
+        return ret
     else:
         return XendDomain.instance().list_names(state)
 


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] PATCH: Ignore errors from dieing domains in RPC server, Daniel P. Berrange <=