# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1301571102 -3600
# Node ID e307b27c955b1fb0f0ef5e391fa9e37976d43d84
# Parent d0dd569bfcb0f5f8e2d903c8b6f9999ff1290e96
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 <ian.campbell@xxxxxxxxxx>
diff -r d0dd569bfcb0 -r e307b27c955b tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Thu Mar 31 12:31:29 2011 +0100
+++ b/tools/libxl/libxl.h Thu Mar 31 12:31:42 2011 +0100
@@ -245,7 +245,7 @@ enum {
#define LIBXL_VERSION 0
-enum libxl_action_on_shutdown {
+typedef enum libxl_action_on_shutdown {
LIBXL_ACTION_DESTROY,
LIBXL_ACTION_RESTART,
@@ -255,7 +255,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;
@@ -271,10 +271,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 -r d0dd569bfcb0 -r e307b27c955b tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Thu Mar 31 12:31:29 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c Thu Mar 31 12:31:42 2011 +0100
@@ -442,7 +442,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;
@@ -1166,7 +1166,7 @@ static int handle_domain_death(libxl_ctx
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:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|