All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] Prevent xend from starting duplicate domains
@ 2005-09-14 20:50 Ian Pratt
  2005-09-14 21:03 ` Dan Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Pratt @ 2005-09-14 20:50 UTC (permalink / raw)
  To: Christian.Limpach, Dan Smith; +Cc: xen-devel

> On 9/14/05, Dan Smith <danms@us.ibm.com> wrote:
> > IP> That way, even if something has gone wrong and we're 
> left with a 
> > IP> shell domain we'll still be able to restart one with the same 
> > IP> name. (obviously we should only do the rename once)
> > 
> > In xm-test, this problem starts showing up towards the end 
> of the test 
> > run, and increases in frequency.  My guess is that if we were to do 
> > the rename once, it would occasionally allow another domain to be 
> > created, but under high load, would not help that much.
> 
> How about we rename the domain to its uuid[1][2] and don't 
> display those in xm list unless a verbose option is given?

I think I like the idea of still showing them in 'xm list' just so we
get bug reorts filed.

zombie-domid-name ?

Ian
 
>     christian
> 
> [1] <name>-zombie-<domid> could work as well...
> [2] or clear the name and change list to supply the uuid if 
> there's no name...
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] Prevent xend from starting duplicate domains
@ 2005-09-14 12:04 Ian Pratt
  2005-09-14 13:36 ` Dan Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Pratt @ 2005-09-14 12:04 UTC (permalink / raw)
  To: Dan Smith, xen-devel

 > 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 <danms@us.ibm.com>

When doing an 'xm destroy' on a domain I wander if xend should rename it
to zombie-<name>?  That way, even if something has gone wrong and we're
left with a shell domain we'll still be able to restart one with the
same name. (obviously we should only do the rename once)

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH] Prevent xend from starting duplicate domains
@ 2005-09-13 21:46 Dan Smith
  2005-09-13 23:20 ` David Hopwood
  2005-09-16 19:40 ` Christian Limpach
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Smith @ 2005-09-13 21:46 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

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 <danms@us.ibm.com>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xend-dup.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

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
 

[-- Attachment #3: Type: text/plain, Size: 88 bytes --]


-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

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

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

end of thread, other threads:[~2005-09-16 23:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 20:50 [PATCH] Prevent xend from starting duplicate domains Ian Pratt
2005-09-14 21:03 ` Dan Smith
  -- strict thread matches above, loose matches on Subject: below --
2005-09-14 12:04 Ian Pratt
2005-09-14 13:36 ` Dan Smith
2005-09-14 17:15   ` Christian Limpach
2005-09-13 21:46 Dan Smith
2005-09-13 23:20 ` David Hopwood
2005-09-14  0:06   ` Dan Smith
2005-09-14  4:32     ` Anthony Liguori
2005-09-16 19:40 ` Christian Limpach
2005-09-16 22:49   ` Dan Smith
2005-09-16 23:47     ` Christian Limpach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.