All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Smith <danms@us.ibm.com>
To: Xen Developers <xen-devel@lists.xensource.com>
Cc: Xen Tools Developers <xen-tools@lists.xensource.com>
Subject: [PATCH] Make xend reject duplicates and rename zombies
Date: Thu, 15 Sep 2005 08:49:40 -0700	[thread overview]
Message-ID: <87br2uz5yj.fsf@us.ibm.com> (raw)

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

             reply	other threads:[~2005-09-15 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15 15:49 Dan Smith [this message]
2005-09-15 18:54 ` [PATCH] Make xend reject duplicates and rename zombies 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87br2uz5yj.fsf@us.ibm.com \
    --to=danms@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-tools@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.