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

[Xen-changelog] [xen-unstable] libxl: return libxl_dominfo from libxl_event_get_domain_death_info



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280246306 -3600
# Node ID 5d8db087cc453e8758216bcd8b5da710282990d4
# Parent  9510eef2439e9d7a0202fbe223ad1a41dd074a50
libxl: return libxl_dominfo from libxl_event_get_domain_death_info

Removes a libxc data type from the libxl interface.

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

diff -r 9510eef2439e -r 5d8db087cc45 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Jul 27 16:57:38 2010 +0100
+++ b/tools/libxl/libxl.c       Tue Jul 27 16:58:26 2010 +0100
@@ -702,20 +702,19 @@ int libxl_free_waiter(libxl_waiter *wait
     return 0;
 }
 
-int libxl_event_get_domain_death_info(struct libxl_ctx *ctx, uint32_t domid, 
libxl_event *event, xc_domaininfo_t *info)
+int libxl_event_get_domain_death_info(struct libxl_ctx *ctx, uint32_t domid, 
libxl_event *event, struct libxl_dominfo *info)
 {
     int rc = 0, ret;
-
     if (event && event->type == LIBXL_EVENT_DOMAIN_DEATH) {
-        ret = xc_domain_getinfolist(ctx->xch, domid, 1, info);
-        if (ret == 1 && info->domain == domid) {
-                if (info->flags & XEN_DOMINF_running ||
-                    (!(info->flags & XEN_DOMINF_shutdown) && !(info->flags & 
XEN_DOMINF_dying)))
+        ret = libxl_domain_info(ctx, info, domid);
+
+        if (ret == 0 && info->domid == domid) {
+            if (info->running || (!info->shutdown && !info->dying))
                     goto out;
                 rc = 1;
                 goto out;
         }
-        memset(info, 0, sizeof(xc_dominfo_t));
+        memset(info, 0, sizeof(*info));
         rc = 1;
         goto out;
     }
diff -r 9510eef2439e -r 5d8db087cc45 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Jul 27 16:57:38 2010 +0100
+++ b/tools/libxl/libxl.h       Tue Jul 27 16:58:26 2010 +0100
@@ -393,7 +393,7 @@ int libxl_free_event(libxl_event *event)
 int libxl_free_event(libxl_event *event);
 int libxl_free_waiter(libxl_waiter *waiter);
 
-int libxl_event_get_domain_death_info(struct libxl_ctx *ctx, uint32_t domid, 
libxl_event *event, xc_domaininfo_t *info);
+int libxl_event_get_domain_death_info(struct libxl_ctx *ctx, uint32_t domid, 
libxl_event *event, struct libxl_dominfo *info);
 int libxl_event_get_disk_eject_info(struct libxl_ctx *ctx, uint32_t domid, 
libxl_event *event, libxl_device_disk *disk);
 
 int libxl_domain_rename(struct libxl_ctx *ctx, uint32_t domid,
diff -r 9510eef2439e -r 5d8db087cc45 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:57:38 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jul 27 16:58:26 2010 +0100
@@ -1335,7 +1335,7 @@ start:
     while (1) {
         int ret;
         fd_set rfds;
-        xc_domaininfo_t info;
+        struct libxl_dominfo info;
         libxl_event event;
         libxl_device_disk disk;
         memset(&info, 0x00, sizeof(xc_domaininfo_t));
@@ -1351,11 +1351,10 @@ start:
             case LIBXL_EVENT_DOMAIN_DEATH:
                 if (libxl_event_get_domain_death_info(&ctx, domid, &event, 
&info)) {
                     LOG("Domain %d is dead", domid);
-                    if (info.flags & XEN_DOMINF_dying || (info.flags & 
XEN_DOMINF_shutdown && (((info.flags >> XEN_DOMINF_shutdownshift) & 
XEN_DOMINF_shutdownmask) != SHUTDOWN_suspend))) {
+                    if (info.dying || (info.shutdown && info.shutdown_reason 
!= SHUTDOWN_suspend)) {
                         LOG("Domain %d needs to be clean: destroying the 
domain", domid);
                         libxl_domain_destroy(&ctx, domid, 0);
-                        if (info.flags & XEN_DOMINF_shutdown &&
-                            (((info.flags >> XEN_DOMINF_shutdownshift) & 
XEN_DOMINF_shutdownmask) == SHUTDOWN_reboot)) {
+                        if (info.shutdown && info.shutdown_reason == 
SHUTDOWN_reboot) {
                             libxl_free_waiter(w1);
                             libxl_free_waiter(w2);
                             free(w1);

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


 


Rackspace

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