[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4 of 9] libxl: should consider shutdown_reason for dying as well as shutdown domains



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280140563 -3600
# Node ID 982bf44850029802b7395a03659bf440d191be2f
# Parent  1e0b63948031587b958ea307410d19c7b2be9614
libxl: should consider shutdown_reason for dying as well as shutdown domains.

A dying domain is one which has notified the hypervisor (with
SCHEDOP_shutdown) and provided a reason code but which hasn't actually
shutdown yet.

Therefore a domain which is dying will always have a valid
shutdown_reason and therefore we should obey it.

Failure to do so means there is a race between domain cleanup in the
hypervisor and the toolstack notification which can mean we may
destroy a domain which actually wanted to be rebooted.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 1e0b63948031 -r 982bf4485002 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Jul 26 11:36:02 2010 +0100
+++ b/tools/libxl/libxl.c       Mon Jul 26 11:36:03 2010 +0100
@@ -416,7 +416,7 @@ static void xcinfo2xlinfo(const xc_domai
     xlinfo->crashed  = 0;
     xlinfo->shutdown_reason  = -1;
 
-    if (xlinfo->shutdown) {
+    if (xlinfo->dying || xlinfo->shutdown) {
         switch ((xcinfo->flags>>XEN_DOMINF_shutdownshift) & 
XEN_DOMINF_shutdownmask) {
         case SHUTDOWN_poweroff:
             xlinfo->shutdown_reason = LIBXL_SHUTDOWN_POWEROFF;
@@ -429,7 +429,7 @@ static void xcinfo2xlinfo(const xc_domai
             break;
         case SHUTDOWN_crash:
             xlinfo->shutdown_reason = LIBXL_SHUTDOWN_CRASH;
-            xlinfo->shutdown = 0;
+            xlinfo->shutdown = xlinfo->dying = 0;
             xlinfo->crashed  = 1;
             break;
         case SHUTDOWN_watchdog:

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.