All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make xend reject duplicates and rename zombies
@ 2005-09-15 15:49 Dan Smith
  2005-09-15 18:54 ` Anthony Liguori
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Smith @ 2005-09-15 15:49 UTC (permalink / raw)
  To: Xen Developers; +Cc: Xen Tools Developers

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

This patch is an update of my previous anti-duplicate-domain patch.
Now, we check an existing same-name domain to see if it's in the
"terminated" state, renaming it to "zombie-domid-name" if so.

This basically makes the problem go away for me, as it gives the dying
domain time to clean itself up.

Test 10_create_fastdestroy from the next release of xm-test validates
that this fixes the problem.

Signed-off-by: Dan Smith <danms@us.ibm.com>


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

diff -r c27431cf81f9 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py	Thu Sep 15 13:17:24 2005
+++ b/tools/python/xen/xend/XendDomain.py	Thu Sep 15 08:44:22 2005
@@ -297,6 +297,20 @@
         @param config: configuration
         @return: domain
         """
+
+        existing = self.domains.get_by_name(sxp.child_value(config, "name"))
+        if existing:
+            if existing.is_terminated():
+                newname = "zombie-%i-%s" % (existing.domid, existing.name)
+                log.debug("Renaming zombie domain %s -> %s" %
+                          (existing.name, newname))
+                existing.setName(newname)
+            else:
+                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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-15 15:49 [PATCH] Make xend reject duplicates and rename zombies Dan Smith
2005-09-15 18:54 ` Anthony Liguori
2005-09-15 19:16   ` Dan Smith
2005-09-16 14:45     ` Ted Kaczmarek
2005-09-16 19:52   ` [Xen-tools] " Christian Limpach
2005-09-16 21:37     ` Anthony Liguori
2005-09-16 21:48       ` Christian Limpach
2005-09-16 21:49         ` Anthony Liguori
2005-09-16 22:19           ` 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.