aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:34 +0100
committerRoger Pau Monne <roger.pau@citrix.com>2012-07-26 16:47:34 +0100
commitb24dc64ef34437c958b40a71f510f404e0c4bbe4 (patch)
tree45d6b1f9269c422f0618918c64f4ba41752ddb7b /tools/libxl/libxl.c
parent24bc7a06aea0dd3cb3c9e0ba6c0367d54fdd503e (diff)
downloadxen-b24dc64ef34437c958b40a71f510f404e0c4bbe4.tar.gz
xen-b24dc64ef34437c958b40a71f510f404e0c4bbe4.tar.bz2
xen-b24dc64ef34437c958b40a71f510f404e0c4bbe4.zip
libxl: call hotplug scripts for disk 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 disk devices, that should be called when the device is added or removed from a guest. We will chain the launch of the disk hotplug scripts after the device_backend_callback callback, or directly from libxl__initiate_device_{add,remove} if the device is already in the desired state. 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.c')
-rw-r--r--tools/libxl/libxl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index da9ddff4aa..1f79865958 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1858,6 +1858,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
flexarray_append(back, "params");
flexarray_append(back, dev);
+ flexarray_append(back, "script");
+ flexarray_append(back, GCSPRINTF("%s/%s",
+ libxl__xen_script_dir_path(),
+ "block"));
+
assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD);
break;
case LIBXL_DISK_BACKEND_TAP:
@@ -1873,6 +1878,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
libxl__device_disk_string_of_format(disk->format),
disk->pdev_path));
+ flexarray_append(back, "script");
+ flexarray_append(back, GCSPRINTF("%s/%s",
+ libxl__xen_script_dir_path(),
+ "blktap"));
+
/* now create a phy device to export the device to the guest */
goto do_backend_phy;
case LIBXL_DISK_BACKEND_QDISK: