All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix another race condition in xm destroy
@ 2005-09-16  4:42 Anthony Liguori
  2005-09-16 19:00 ` Christian Limpach
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2005-09-16  4:42 UTC (permalink / raw)
  To: xen-devel, Christian Limpach

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

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-16  4:42 [PATCH] Fix another race condition in xm destroy Anthony Liguori
2005-09-16 19:00 ` Christian Limpach
2005-09-16 21:35   ` Anthony Liguori

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.