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] libxenlight: get state for one domain

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: get state for one domain
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Dec 2009 23:20:31 -0800
Delivery-date: Thu, 03 Dec 2009 23:21:38 -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 1259910704 0
# Node ID fde8e69858b01c3545d492c0b29f22102ddf21ca
# Parent  10729bee8f8a1ae2a64ab49726b44742ceafac57
libxenlight: get state for one domain

Simple function to get the dominfo state of a single domain.

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
---
 tools/libxl/libxl.c |   25 +++++++++++++++++++++++++
 tools/libxl/libxl.h |    1 +
 2 files changed, 26 insertions(+)

diff -r 10729bee8f8a -r fde8e69858b0 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Dec 04 07:11:06 2009 +0000
+++ b/tools/libxl/libxl.c       Fri Dec 04 07:11:44 2009 +0000
@@ -362,6 +362,31 @@ static int libxl_save_device_model(struc
     return 0;
 }
 
+xc_dominfo_t *libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid)
+{
+    xc_dominfo_t *info;
+    int rc;
+
+    info = (xc_dominfo_t *) calloc(1, sizeof(xc_dominfo_t));
+    if (!info) {
+        return NULL;
+    }
+    rc = xc_domain_getinfo(ctx->xch, domid, 1, info);
+    if (rc != 1) {
+        free(info);
+        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "Failed to get info for domain %u", 
+                        domid);
+        return NULL;
+    }
+    if (info->domid != domid) {
+        free(info);
+        XL_LOG(ctx, XL_LOG_ERROR, "Failed to get info for domain %u"
+                        ", seems to not exist anymore", domid);
+        return NULL;
+    }
+
+    return info;
+}
 int libxl_domain_suspend(struct libxl_ctx *ctx, libxl_domain_suspend_info 
*info,
                          uint32_t domid, int fd)
 {
diff -r 10729bee8f8a -r fde8e69858b0 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Fri Dec 04 07:11:06 2009 +0000
+++ b/tools/libxl/libxl.h       Fri Dec 04 07:11:44 2009 +0000
@@ -276,6 +276,7 @@ int libxl_console_attach(struct libxl_ct
 
 struct libxl_dominfo * libxl_domain_list(struct libxl_ctx *ctx, int 
*nb_domain);
 xc_dominfo_t * libxl_domain_infolist(struct libxl_ctx *ctx, int *nb_domain);
+xc_dominfo_t * libxl_domain_info(struct libxl_ctx *ctx, uint32_t domid);
 
 typedef struct libxl_device_model_starting libxl_device_model_starting;
 int libxl_create_device_model(struct libxl_ctx *ctx,

_______________________________________________
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] libxenlight: get state for one domain, Xen patchbot-unstable <=