From: Ian Campbell Date: Thu, 31 Mar 2011 18:39:30 +0000 (+0100) Subject: libxl: typedef libxl_action_on_shutdown X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9da48f2428c5970f0350c74e07c4ca479d3fa06d;p=people%2Fliuw%2Flibxenctrl-split%2Fxen.git libxl: typedef libxl_action_on_shutdown 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 Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index f4f90377c1..9bf5260482 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -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 */ diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 3cf3ee24a6..6d31e5cdcf 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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: