From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Smith Subject: [PATCH] Prevent xend from starting duplicate domains Date: Tue, 13 Sep 2005 14:46:34 -0700 Message-ID: <87d5ncsksl.fsf@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-=-= The attached patch puts a simple check in domain_create() which prevents starting a domain if there is already one of the same name in the domain list. This fixes the problem of getting the following error message from xm while creating a domain soon after destroying one with the same name: xen.xend.XendProtocol.XendError: (3, 'No such process') Signed-off-by: Dan Smith --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=xend-dup.patch diff -r 3a34bcb7c28b tools/python/xen/xend/XendDomain.py --- a/tools/python/xen/xend/XendDomain.py Tue Sep 13 19:09:44 2005 +++ b/tools/python/xen/xend/XendDomain.py Tue Sep 13 13:25:08 2005 @@ -296,6 +296,13 @@ @param config: configuration @return: domain """ + + existing = self.domains.get_by_name(sxp.child_value(config, "name")) + if existing: + log.debug("Attempt to create duplicate domain %s" % existing.name) + raise XendError("Domain %s already exists as %i!" % + (existing.name, existing.id)) + dominfo = XendDomainInfo.create(self.dbmap, config) return dominfo --=-=-= -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--