[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 09 of 29 RFC] libxl: add better error checking on libxl__device_remove
# HG changeset patch # User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx> # Date 1328176865 -3600 # Node ID 8a5a82c9819558015ac75afdef28ee3d88d4f334 # Parent 1efb9ee82433896e5a68f9a510f1f5542f071bd3 libxl: add better error checking on libxl__device_remove Check return value of libxl__wait_for_device_state on libxl__device_remove and print an error message accordingly. Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx> diff -r 1efb9ee82433 -r 8a5a82c98195 tools/libxl/libxl_device.c --- a/tools/libxl/libxl_device.c Thu Feb 02 10:57:46 2012 +0100 +++ b/tools/libxl/libxl_device.c Thu Feb 02 11:01:05 2012 +0100 @@ -503,8 +503,17 @@ retry_transaction: tv.tv_usec = 0; rc = libxl__wait_for_device_state(gc, &tv, XenbusStateClosed, destroy_device); - if (rc < 0) /* an error or timeout occurred, clear watches */ + if (rc == ERROR_TIMEDOUT) { + LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, + "Timeout while waiting for unplug of " + "device with backend path %s", be_path); xs_unwatch(ctx->xsh, state_path, be_path); + } else if (rc == ERROR_FAIL) { + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, + "failed to destroy device with " + "backend path %s", be_path); + xs_unwatch(ctx->xsh, state_path, be_path); + } xs_rm(ctx->xsh, XBT_NULL, libxl__device_frontend_path(gc, dev)); out: _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |