aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_linux.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2013-01-23 17:55:39 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-03-13 14:48:00 +0000
commitd46d13606e5533d63a83c6541942d7d66f217896 (patch)
tree4d06397206690cbde9e7e1515b85b9eea58c9f90 /tools/libxl/libxl_linux.c
parentf493a3228f7c3c6937f2798fea1f4ed44fb3a425 (diff)
downloadxen-d46d13606e5533d63a83c6541942d7d66f217896.tar.gz
xen-d46d13606e5533d63a83c6541942d7d66f217896.tar.bz2
xen-d46d13606e5533d63a83c6541942d7d66f217896.zip
libxl: move libxl_device_action to idl
Move to idl for ease of expansion and auto-generated functions. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_linux.c')
-rw-r--r--tools/libxl/libxl_linux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/libxl/libxl_linux.c b/tools/libxl/libxl_linux.c
index 1fed3cd521..1ef13c011f 100644
--- a/tools/libxl/libxl_linux.c
+++ b/tools/libxl/libxl_linux.c
@@ -173,11 +173,12 @@ static int libxl__hotplug_nic(libxl__gc *gc, libxl__device *dev,
(*args)[nr++] = script;
if (nictype == LIBXL_NIC_TYPE_VIF_IOEMU && num_exec) {
- (*args)[nr++] = action == DEVICE_CONNECT ? "add" : "remove";
+ (*args)[nr++] = (char *) libxl__device_action_to_string(action);
(*args)[nr++] = "type_if=tap";
(*args)[nr++] = NULL;
} else {
- (*args)[nr++] = action == DEVICE_CONNECT ? "online" : "offline";
+ (*args)[nr++] = action == LIBXL__DEVICE_ACTION_ADD ? "online" :
+ "offline";
(*args)[nr++] = "type_if=vif";
(*args)[nr++] = NULL;
}
@@ -213,7 +214,7 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__device *dev,
const int arraysize = 3;
GCNEW_ARRAY(*args, arraysize);
(*args)[nr++] = script;
- (*args)[nr++] = action == DEVICE_CONNECT ? "add" : "remove";
+ (*args)[nr++] = (char *) libxl__device_action_to_string(action);
(*args)[nr++] = NULL;
assert(nr == arraysize);