aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_internal.h
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:35 +0100
committerRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:35 +0100
commit57ad6afe2a08a03c40bcd336bfb27e008e1d3e53 (patch)
tree5458836e1fff4d42ab9cdc3bebb9d9225a6247f3 /tools/libxl/libxl_internal.h
parentb24dc64ef34437c958b40a71f510f404e0c4bbe4 (diff)
downloadxen-57ad6afe2a08a03c40bcd336bfb27e008e1d3e53.tar.gz
xen-57ad6afe2a08a03c40bcd336bfb27e008e1d3e53.tar.bz2
xen-57ad6afe2a08a03c40bcd336bfb27e008e1d3e53.zip
libxl: call hotplug scripts for nic devices from libxl
Since most of the needed work is already done in previous patches, this patch only contains the necessary code to call hotplug scripts for nic devices, that should be called when the device is added or removed from a guest. Added another parameter to libxl__get_hotplug_script_info, that is used to know the number of times hotplug scripts have been called for that device. This is currently used by IOEMU nics on Linux. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Acked-by: Ian Jackson<ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_internal.h')
-rw-r--r--tools/libxl/libxl_internal.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2567c4d38a..cf5ab712ad 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -920,6 +920,8 @@ _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
libxl__device *dev);
_hidden int libxl__device_destroy(libxl__gc *gc, libxl__device *dev);
_hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
+_hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
+ libxl_nic_type *nictype);
/*
* For each aggregate type which can be used as an input we provide:
@@ -1840,6 +1842,7 @@ struct libxl__ao_device {
libxl__ao_devices *aodevs;
/* device hotplug execution */
const char *what;
+ int num_exec;
libxl__ev_child child;
};
@@ -1979,10 +1982,19 @@ _hidden void libxl__initiate_device_remove(libxl__egc *egc,
* < 0: Error
* 0: No need to execute hotplug script
* 1: Execute hotplug script
+ *
+ * The last parameter, "num_exec" refeers to the number of times hotplug
+ * scripts have been called for this device.
+ *
+ * The main body of libxl will, for each device, keep calling
+ * libxl__get_hotplug_script_info, with incrementing values of
+ * num_exec, and executing the resulting script accordingly,
+ * until libxl__get_hotplug_script_info returns<=0.
*/
_hidden int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev,
char ***args, char ***env,
- libxl__device_action action);
+ libxl__device_action action,
+ int num_exec);
/*----- local disk attach: attach a disk locally to run the bootloader -----*/