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

[Xen-changelog] [xen-unstable] libxl: add shutdown reason to libxl_domin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: add shutdown reason to libxl_dominfo
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Jul 2010 04:55:14 -0700
Delivery-date: Wed, 28 Jul 2010 04:57:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280246258 -3600
# Node ID 9510eef2439e9d7a0202fbe223ad1a41dd074a50
# Parent  60f0ba74e18f58949be9e1c075ce2786011831f0
libxl: add shutdown reason to libxl_dominfo

Removes the need for explicit libxl_dominfo.crashed so remove it.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c      |   15 +++++----------
 tools/libxl/libxl.h      |   10 +++++++++-
 tools/libxl/xl_cmdimpl.c |    2 +-
 3 files changed, 15 insertions(+), 12 deletions(-)

diff -r 60f0ba74e18f -r 9510eef2439e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Jul 27 16:57:06 2010 +0100
+++ b/tools/libxl/libxl.c       Tue Jul 27 16:57:38 2010 +0100
@@ -405,8 +405,6 @@ static void xcinfo2xlinfo(const xc_domai
 static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
                           struct libxl_dominfo *xlinfo)
 {
-    unsigned int shutdown_reason;
-
     memcpy(&(xlinfo->uuid), xcinfo->handle, sizeof(xen_domain_handle_t));
     xlinfo->domid = xcinfo->domain;
 
@@ -415,14 +413,11 @@ static void xcinfo2xlinfo(const xc_domai
     xlinfo->paused   = !!(xcinfo->flags&XEN_DOMINF_paused);
     xlinfo->blocked  = !!(xcinfo->flags&XEN_DOMINF_blocked);
     xlinfo->running  = !!(xcinfo->flags&XEN_DOMINF_running);
-    xlinfo->crashed  = 0;
-
-    shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & 
XEN_DOMINF_shutdownmask;
-
-    if ( xlinfo->shutdown && (shutdown_reason == SHUTDOWN_crash) ) {
-        xlinfo->shutdown = 0;
-        xlinfo->crashed  = 1;
-    }
+
+    if (xlinfo->shutdown || xlinfo->dying)
+        xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & 
XEN_DOMINF_shutdownmask;
+    else
+        xlinfo->shutdown_reason  = ~0;
 
     xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->cpu_time = xcinfo->cpu_time;
diff -r 60f0ba74e18f -r 9510eef2439e tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Jul 27 16:57:06 2010 +0100
+++ b/tools/libxl/libxl.h       Tue Jul 27 16:57:38 2010 +0100
@@ -29,8 +29,16 @@ struct libxl_dominfo {
     uint8_t blocked:1;
     uint8_t paused:1;
     uint8_t shutdown:1;
-    uint8_t crashed:1;
     uint8_t dying:1;
+
+    /*
+     * Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+     *
+     * Otherwise set to a value guaranteed not to clash with any valid
+     * SHUTDOWN_* constant.
+     */
+    unsigned int shutdown_reason;
+
     uint64_t max_memkb;
     uint64_t cpu_time;
     uint32_t vcpu_max_id;
diff -r 60f0ba74e18f -r 9510eef2439e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:57:06 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:57:38 2010 +0100
@@ -1935,7 +1935,7 @@ void list_domains(int verbose)
                 info[i].blocked ? 'b' : '-',
                 info[i].paused ? 'p' : '-',
                 info[i].shutdown ? 's' : '-',
-                info[i].crashed ? 'c' : '-',
+                info[i].shutdown_reason == SHUTDOWN_crash ? 'c' : '-',
                 info[i].dying ? 'd' : '-',
                 ((float)info[i].cpu_time / 1e9));
         if (verbose) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: add shutdown reason to libxl_dominfo, Xen patchbot-unstable <=