[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 08 of 13 RFC] libxl: add better error checking on libxl__device_remove



# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1326728440 -3600
# Node ID 5849bf7c4507edbe900de00332f1218de2d9f45f
# Parent  2a28a1126ab2fd6ab6b5c959daabdc6b3afd1fc6
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 2a28a1126ab2 -r 5849bf7c4507 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Mon Jan 16 16:40:26 2012 +0100
+++ b/tools/libxl/libxl_device.c        Mon Jan 16 16:40:40 2012 +0100
@@ -511,8 +511,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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.