]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxl: typedef libxl_action_on_shutdown
authorIan Campbell <ian.campbell@citrix.com>
Thu, 31 Mar 2011 18:39:30 +0000 (19:39 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Mar 2011 18:39:30 +0000 (19:39 +0100)
This is the libxl convention. By using the "typedef enum foo { } foo;"
syntax we can retain backwards compatibility with existing users.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.h
tools/libxl/xl_cmdimpl.c

index f4f90377c14fdec2514bac2dcb8aadf248e8a400..9bf5260482e7474513c3196b30c4097239f1c840 100644 (file)
@@ -250,7 +250,7 @@ enum {
 
 #define LIBXL_VERSION 0
 
-enum libxl_action_on_shutdown {
+typedef enum libxl_action_on_shutdown {
     LIBXL_ACTION_DESTROY,
 
     LIBXL_ACTION_RESTART,
@@ -260,7 +260,7 @@ enum libxl_action_on_shutdown {
 
     LIBXL_ACTION_COREDUMP_DESTROY,
     LIBXL_ACTION_COREDUMP_RESTART,
-};
+} libxl_action_on_shutdown;
 
 typedef struct {
     libxl_domain_create_info c_info;
@@ -276,10 +276,10 @@ typedef struct {
     libxl_device_vfb *vfbs;
     libxl_device_vkb *vkbs;
 
-    enum libxl_action_on_shutdown on_poweroff;
-    enum libxl_action_on_shutdown on_reboot;
-    enum libxl_action_on_shutdown on_watchdog;
-    enum libxl_action_on_shutdown on_crash;
+    libxl_action_on_shutdown on_poweroff;
+    libxl_action_on_shutdown on_reboot;
+    libxl_action_on_shutdown on_watchdog;
+    libxl_action_on_shutdown on_crash;
 } libxl_domain_config;
 
 /* context functions */
index 3cf3ee24a65121084eef52f348a0e872ea28a56b..6d31e5cdcf957067903eb116efff0cc30f81e2ac 100644 (file)
@@ -441,7 +441,7 @@ static void printf_info(int domid,
        printf(")\n");
 }
 
-static int parse_action_on_shutdown(const char *buf, enum libxl_action_on_shutdown *a)
+static int parse_action_on_shutdown(const char *buf, libxl_action_on_shutdown *a)
 {
     int i;
     const char *n;
@@ -1165,7 +1165,7 @@ static int handle_domain_death(libxl_ctx *ctx, uint32_t domid, libxl_event *even
                                libxl_domain_config *d_config, libxl_dominfo *info)
 {
     int restart = 0;
-    enum libxl_action_on_shutdown action;
+    libxl_action_on_shutdown action;
 
     switch (info->shutdown_reason) {
     case SHUTDOWN_poweroff: