WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4 of 9] libxl: should consider shutdown_reason for dy

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 9] libxl: should consider shutdown_reason for dying as well as shutdown domains
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 26 Jul 2010 11:56:48 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 26 Jul 2010 04:07:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1280141804@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>