WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1 of 4] libxl: typedef libxl_action_on_shutdown

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1 of 4] libxl: typedef libxl_action_on_shutdown
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 31 Mar 2011 12:38:10 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 31 Mar 2011 04:40:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1301571489@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1301571489@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# 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