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

Re: [Xen-devel] Re: [Pkg-xen-devel] xen 4.1 blktap2 support



On Fri, 2011-04-29 at 12:08 +0100, Bastian Blank wrote:
> On Thu, Apr 28, 2011 at 03:20:58PM +0100, Ian Campbell wrote:
> > On Thu, 2011-04-28 at 14:27 +0200, Bastian Blank wrote:
> > > - Silent fail if qemu-dm[1] is missing or failing. It lacks error
> > >   checking.
> > Yes, this could certainly be improved.
> 
> A hang without any feedback is the worst user-experience possible.

On my systems I get, after ~10s:
libxl: error: libxl_device.c:475:libxl__wait_for_device_model Device Model not 
ready
xl: fatal error: libxl_create.c:515, rc=-1: libxl__confirm_device_model_startup
libxl: debug: libxl_dm.c:890:libxl__destroy_device_model Device Model already 
exited

The following makes the obvious qemu-dm not present / not executable
case fail immediately by adding an access(..., X_OK) check, which is
something of an improvement.

This still leaves the delay for other cases, e.g. immediate failure due
to a missing library, bad parameters etc. I think with a little bit of
refactoring libxl__wait_for_device_model() could incorporate the
necessary check for child exit without simply waiting for the entire
delay. I'll take a closer look at this and the other issues you reported
tomorrow.

Ian.

8<------------------------------
libxl: check that device model binary is executable.

This causes us to fail more quickly in more obvious failure case of not
having the right binary installed.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

--- a/tools/libxl/libxl_dm.c    Tue May 03 16:53:22 2011 +0100
+++ b/tools/libxl/libxl_dm.c    Tue May 03 17:34:19 2011 +0100
@@ -762,7 +762,12 @@ int libxl__create_device_model(libxl__gc
         rc = ERROR_FAIL;
         goto out;
     }
-
+    if (access(dm, X_OK) < 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                         "device model %s is not executable", dm);
+        rc = ERROR_FAIL;
+        goto out;
+    }
     args = libxl__build_device_model_args(gc, dm, info, disks, num_disks,
                                           vifs, num_vifs);
     if (!args) {


-- 
Ian Campbell
Current Noise: Karma To Burn - Mt. Penetrator

Winning isn't everything, but losing isn't anything.


_______________________________________________
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®.