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-changelog

[Xen-changelog] The dom destroy path is doing a dom_get on a non-existen

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] The dom destroy path is doing a dom_get on a non-existent domain to
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Sep 2005 22:38:10 +0000
Delivery-date: Wed, 14 Sep 2005 22:36:40 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User shand@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID fb72c78604c673bb07915675620bce3b7630e323
# Parent  122779b57b40600dcaf2d147ca82ec23da8e2c96
The dom destroy path is doing a dom_get on a non-existent domain to  
ensure it is non-existent.  This changes throws an explicit exception  
when xc_domain_getinfo returns an error, instead of triggering an  
internal python error.  It then handles the exception in dom_get by  
returning None, which callers already expect to mean failure.

Signed-off-by: Robert Read <robert@xxxxxxxxxxxxx>

diff -r 122779b57b40 -r fb72c78604c6 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Sep 14 20:45:40 2005
+++ b/tools/python/xen/lowlevel/xc/xc.c Wed Sep 14 22:36:29 2005
@@ -220,6 +220,9 @@
         return PyErr_NoMemory();
 
     nr_doms = xc_domain_getinfo(xc->xc_handle, first_dom, max_doms, info);
+
+    if (nr_doms < 0)
+        return PyErr_SetFromErrno(xc_error);
     
     list = PyList_New(nr_doms);
     for ( i = 0 ; i < nr_doms; i++ )
diff -r 122779b57b40 -r fb72c78604c6 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Sep 14 20:45:40 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Sep 14 22:36:29 2005
@@ -110,9 +110,13 @@
     @param dom: domain id
     @return: info or None
     """
-    domlist = xc.domain_getinfo(dom, 1)
-    if domlist and dom == domlist[0]['dom']:
-        return domlist[0]
+    try:
+        domlist = xc.domain_getinfo(dom, 1)
+        if domlist and dom == domlist[0]['dom']:
+            return domlist[0]
+    except Exception, err:
+        # ignore missing domain
+        log.exception("domain_getinfo(%d) failed, ignoring", dom)
     return None
 
 class XendDomainInfo:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] The dom destroy path is doing a dom_get on a non-existent domain to, Xen patchbot -unstable <=