From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 1 of 4] libxl: typedef libxl_action_on_shutdown Date: Thu, 31 Mar 2011 12:38:10 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # 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 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: