xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 1 of 9] libxl: Add LIBXL_EVENT namespace to enum libxl_event_type
Date: Mon, 26 Jul 2010 11:56:45 +0100	[thread overview]
Message-ID: <7a0c37f2a9b51ac012a3.1280141805@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1280141804@localhost.localdomain>

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1280140562 -3600
# Node ID 7a0c37f2a9b51ac012a32bcf6ab222580e7cac94
# Parent  74c8b1f2c2da28fe00492add40a32a257e44dca7
libxl: Add LIBXL_EVENT namespace to enum libxl_event_type

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 74c8b1f2c2da -r 7a0c37f2a9b5 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:02 2010 +0100
@@ -643,7 +643,7 @@ int libxl_wait_for_domain_death(struct l
 int libxl_wait_for_domain_death(struct libxl_ctx *ctx, uint32_t domid, libxl_waiter *waiter)
 {
     waiter->path = strdup("@releaseDomain");
-    if (asprintf(&(waiter->token), "%d", DOMAIN_DEATH) < 0)
+    if (asprintf(&(waiter->token), "%d", LIBXL_EVENT_DOMAIN_DEATH) < 0)
         return -1;
     if (!xs_watch(ctx->xsh, waiter->path, waiter->token))
         return -1;
@@ -663,7 +663,7 @@ int libxl_wait_for_disk_ejects(struct li
                      libxl_xs_get_dompath(ctx, domid),
                      device_disk_dev_number(disks[i].virtpath)) < 0)
             return -1;
-        if (asprintf(&(waiter[i].token), "%d", DISK_EJECT) < 0)
+        if (asprintf(&(waiter[i].token), "%d", LIBXL_EVENT_DISK_EJECT) < 0)
             return -1;
         xs_watch(ctx->xsh, waiter->path, waiter->token);
     }
@@ -711,7 +711,7 @@ int libxl_event_get_domain_death_info(st
 {
     int rc = 0, ret;
 
-    if (event && event->type == DOMAIN_DEATH) {
+    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 ||
@@ -730,7 +730,7 @@ out:
 
 int libxl_event_get_disk_eject_info(struct libxl_ctx *ctx, uint32_t domid, libxl_event *event, libxl_device_disk *disk)
 {
-    if (event && event->type == DISK_EJECT) {
+    if (event && event->type == LIBXL_EVENT_DISK_EJECT) {
         char *path;
         char *backend;
         char *value = libxl_xs_read(ctx, XBT_NULL, event->path);
diff -r 74c8b1f2c2da -r 7a0c37f2a9b5 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Mon Jul 26 11:36:02 2010 +0100
+++ b/tools/libxl/libxl.h	Mon Jul 26 11:36:02 2010 +0100
@@ -357,8 +357,8 @@ char *libxl_uuid2string(struct libxl_ctx
 /* events handling */
 
 typedef enum {
-    DOMAIN_DEATH,
-    DISK_EJECT,
+    LIBXL_EVENT_DOMAIN_DEATH,
+    LIBXL_EVENT_DISK_EJECT,
 } libxl_event_type;
 
 typedef struct {
diff -r 74c8b1f2c2da -r 7a0c37f2a9b5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Mon Jul 26 11:36:02 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Mon Jul 26 11:36:02 2010 +0100
@@ -1348,7 +1348,7 @@ start:
             continue;
         libxl_get_event(&ctx, &event);
         switch (event.type) {
-            case DOMAIN_DEATH:
+            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))) {
@@ -1374,7 +1374,7 @@ start:
                     exit(0);
                 }
                 break;
-            case DISK_EJECT:
+            case LIBXL_EVENT_DISK_EJECT:
                 if (libxl_event_get_disk_eject_info(&ctx, domid, &event, &disk))
                     libxl_cdrom_insert(&ctx, domid, &disk);
                 break;

  reply	other threads:[~2010-07-26 10:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 10:56 [PATCH 0 of 9] xl: handle domain shutdown/reboot/crash in a user configurable way Ian Campbell
2010-07-26 10:56 ` Ian Campbell [this message]
2010-07-26 10:56 ` [PATCH 2 of 9] libxl: return libxl_dominfo from libxl_event_get_domain_death_info Ian Campbell
2010-07-26 14:32   ` Stefano Stabellini
2010-07-26 14:38     ` Ian Campbell
2010-07-26 14:59       ` Stefano Stabellini
2010-07-26 15:26   ` Ian Jackson
2010-07-26 15:31     ` Ian Campbell
2010-07-26 15:36       ` Ian Jackson
2010-07-26 15:34     ` Stefano Stabellini
2010-07-26 15:41       ` Ian Jackson
2010-07-26 16:23         ` Stefano Stabellini
2010-07-26 16:38           ` Ian Jackson
2010-07-27  9:22             ` Ian Campbell
2010-07-27  9:53             ` Stefano Stabellini
2010-07-26 10:56 ` [PATCH 3 of 9] libxl: signal caller if domain already destroyed on domain death event Ian Campbell
2010-07-26 14:32   ` Stefano Stabellini
2010-07-26 14:41     ` Ian Campbell
2010-07-26 14:58       ` Stefano Stabellini
2010-07-26 15:02         ` Ian Campbell
2010-07-26 15:08           ` Stefano Stabellini
2010-07-26 10:56 ` [PATCH 4 of 9] libxl: should consider shutdown_reason for dying as well as shutdown domains Ian Campbell
2010-07-26 10:56 ` [PATCH 5 of 9] libxl: add libxl_domain_preserve Ian Campbell
2010-07-26 15:30   ` Ian Jackson
2010-07-26 15:56     ` Ian Campbell
2010-07-26 10:56 ` [PATCH 6 of 9] xl: do not try and auto re-connect console on reboot Ian Campbell
2010-07-26 10:56 ` [PATCH 7 of 9] xl: Add function to generate random uuid and use it Ian Campbell
2010-07-26 10:56 ` [PATCH 8 of 9] xl: Factor out domain death handling into a separate function Ian Campbell
2010-07-26 10:56 ` [PATCH 9 of 9] xl: support on_{poweroff, reboot, crash} domain configuration options Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2010-07-27 10:13 [PATCH 0 of 9] xl: handle domain shutdown/reboot/crash in a user configurable way Ian Campbell
2010-07-27 10:13 ` [PATCH 1 of 9] libxl: Add LIBXL_EVENT namespace to enum libxl_event_type Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a0c37f2a9b51ac012a3.1280141805@localhost.localdomain \
    --to=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).