All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>,
	Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Subject: [PATCH] Fix another race condition in xm destroy
Date: Thu, 15 Sep 2005 23:42:34 -0500	[thread overview]
Message-ID: <432A4D3A.6060300@us.ibm.com> (raw)

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

There's a race condition in xm destroy that gets triggered when 
xc_domain_destroy results in a domain disappearing before we invoke the 
cleanup routines.  Specifically, the saveToDB routines will through a No 
such process error.

Christian, I'd appreciate if you could sanity check this before 
committing.  I think it's okay because starting the cleanup shouldn't 
have any adverse effects.  Having another pair of eyes confirm it would 
make me feel better though :-)

BTW, this is not the fix for the xm destroy && xm create race 
condition.  Just another one I found in the process.

Regards,

Anthony Liguori

[-- Attachment #2: 6884-xm-destroy-race.diff --]
[-- Type: text/x-patch, Size: 914 bytes --]

# HG changeset patch
# User anthony@localhost.localdomain
# Node ID 2790025adf8eae599d026c9ad6f0b3deacda9b9f
# Parent  fd19e760932d095b23d38e67eaec24dd02ba3aba
Fix a race in xm destroy.  Once we call xc_domain_destroy, there's no guarentee
that the domain will exist (even immediately after the call).

Starting the cleanup before we call destroy will keep us from getting hosed.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff -r fd19e760932d -r 2790025adf8e tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Thu Sep 15 19:46:14 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Sep 16 04:35:26 2005
@@ -771,9 +771,9 @@
     def destroy(self):
         """Clenup vm and destroy domain.
         """
-        self.destroy_domain()
         self.cleanup()
         self.saveToDB()
+        self.destroy_domain()
         return 0
 
     def is_terminated(self):

[-- Attachment #3: 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-16  4:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-16  4:42 Anthony Liguori [this message]
2005-09-16 19:00 ` [PATCH] Fix another race condition in xm destroy Christian Limpach
2005-09-16 21:35   ` Anthony Liguori

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=432A4D3A.6060300@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=xen-devel@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.