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

Re: [Xen-devel] [PATCH] Prevent xend from destroying Dom0

To: Dan Smith <danms@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Prevent xend from destroying Dom0
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 21 Sep 2005 17:25:34 -0500
Cc: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 21 Sep 2005 22:23:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <87ek7icfl1.fsf@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <87ek7icfl1.fsf@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)
Is it possible to pass DOMID_SELF to domain_lookup?

Regards,

Anthony Liguori

Dan Smith wrote:

This patch adds a check in xend that prevents a user from trying to
destroy Dom0.  Currently, xm does not return an error for this case.
Xend tries to destroy dom0 and leaves the system in an unstable
state.  Subsequent attempts to create a domain result in the following
error message:

 Error: Error creating domain: (106, 'Transport endpoint is already \
 connected')

This will fix bugzilla bug #243

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
------------------------------------------------------------------------

diff -r 9776d03bf108 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Tue Sep 20 13:07:10 2005
+++ b/tools/python/xen/xend/XendDomain.py       Wed Sep 21 13:01:41 2005
@@ -45,6 +45,7 @@
__all__ = [ "XendDomain" ]

SHUTDOWN_TIMEOUT = 30
+PRIV_DOMAIN      =  0

def is_dead(dom):
    return dom['crashed'] or dom['shutdown'] or (
@@ -168,7 +169,7 @@
        self.domain_restarts()

    def dom0_setup(self):
-        dom0 = self.domain_lookup(0)
+        dom0 = self.domain_lookup(PRIV_DOMAIN)
        if not dom0:
            dom0 = self.dom0_unknown()
dom0.dom0_init_store() @@ -337,7 +338,7 @@
        return self.domains.get(id)

    def dom0_unknown(self):
-        dom0 = 0
+        dom0 = PRIV_DOMAIN
        uuid = None
        info = self.xen_domain(dom0)
        dompath = GetDomainPath(dom0)
@@ -505,6 +506,10 @@

        @param domid: domain id
        """
+
+        if domid == PRIV_DOMAIN:
+            raise XendError("Cannot destroy priviliged domain %i" % domid)
+ self.domain_restart_schedule(domid, reason, force=True)
        dominfo = self.domain_lookup(domid)
        if dominfo:
------------------------------------------------------------------------


------------------------------------------------------------------------

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


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

<Prev in Thread] Current Thread [Next in Thread>