[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 12 of 15 v5] libxl: remove frontend and execute hotplug scripts on domain destroy
# HG changeset patch # User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx> # Date 1323939609 -3600 # Node ID 7dbba8f9706d3a1ea777df23f1d40b2da951ef4a # Parent f3d3a0a74f55f07616abc4bac95f82868b91fe9f libxl: remove frontend and execute hotplug scripts on domain destroy Removes frontend path on domain destruction and waits for devices to be disconnected before executing hotplug scripts (call libxl__device_remove to wait for detaching). Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx> diff -r f3d3a0a74f55 -r 7dbba8f9706d tools/libxl/libxl_device.c --- a/tools/libxl/libxl_device.c Thu Dec 15 10:00:09 2011 +0100 +++ b/tools/libxl/libxl_device.c Thu Dec 15 10:00:09 2011 +0100 @@ -492,19 +492,17 @@ int libxl__device_destroy(libxl__gc *gc, libxl_ctx *ctx = libxl__gc_owner(gc); char *be_path = libxl__device_backend_path(gc, dev); char *fe_path = libxl__device_frontend_path(gc, dev); + int rc; - /* - * Run hotplug scripts, which will probably not be able to - * execute successfully since the device may still be plugged - */ - libxl__device_hotplug(gc, dev, DISCONNECT); + xs_rm(ctx->xsh, XBT_NULL, fe_path); + /* Wait for backend status to disconnect */ + rc = libxl__device_remove(gc, dev, 1); xs_rm(ctx->xsh, XBT_NULL, be_path); - xs_rm(ctx->xsh, XBT_NULL, fe_path); libxl__device_destroy_tapdisk(gc, be_path); - return 0; + return rc; } int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |