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 a get_shutdown_reason

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: add a get_shutdown_reason
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 30 Dec 2009 05:40:19 -0800
Delivery-date: Wed, 30 Dec 2009 05:42:45 -0800
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1262177141 0
# Node ID 88e59cfb48de60b3bfd04c74e6ac230d061ae5b0
# Parent  d4613b5217982fa82710adc96a9f1d8b4c0a491e
libxl: add a get_shutdown_reason

Signed-off-by: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_dom.c      |   15 +++++++++++++++
 tools/libxl/libxl_internal.h |    3 +++
 2 files changed, 18 insertions(+)

diff -r d4613b521798 -r 88e59cfb48de tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Wed Dec 30 12:45:13 2009 +0000
+++ b/tools/libxl/libxl_dom.c   Wed Dec 30 12:45:41 2009 +0000
@@ -40,6 +40,21 @@ int is_hvm(struct libxl_ctx *ctx, uint32
     if (info.domain != domid)
         return -1;
     return !!(info.flags & XEN_DOMINF_hvm_guest);
+}
+
+int get_shutdown_reason(struct libxl_ctx *ctx, uint32_t domid)
+{
+    xc_domaininfo_t info;
+    int ret;
+
+    ret = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
+    if (ret != 1)
+        return -1;
+    if (info.domain != domid)
+        return -1;
+    if (!(info.flags & XEN_DOMINF_shutdown))
+        return -1;
+    return dominfo_get_shutdown_reason(&info);
 }
 
 int build_pre(struct libxl_ctx *ctx, uint32_t domid,
diff -r d4613b521798 -r 88e59cfb48de tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Wed Dec 30 12:45:13 2009 +0000
+++ b/tools/libxl/libxl_internal.h      Wed Dec 30 12:45:41 2009 +0000
@@ -124,6 +124,9 @@ char **libxl_xs_directory(struct libxl_c
 
 /* from xl_dom */
 int is_hvm(struct libxl_ctx *ctx, uint32_t domid);
+int get_shutdown_reason(struct libxl_ctx *ctx, uint32_t domid);
+#define dominfo_get_shutdown_reason(info) (((info)->flags >> 
XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask)
+
 int build_pre(struct libxl_ctx *ctx, uint32_t domid,
               libxl_domain_build_info *info, libxl_domain_build_state *state);
 int build_post(struct libxl_ctx *ctx, uint32_t domid,

_______________________________________________
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 a get_shutdown_reason, Xen patchbot-unstable <=