From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Re: [Pkg-xen-devel] xen 4.1 blktap2 support Date: Tue, 03 May 2011 17:39:29 +0100 Message-ID: <1304440769.18845.136.camel@zakaz.uk.xensource.com> References: <4DB82B38.6090207@gmail.com> <4DB89A39.6070203@gmail.com> <4DB91947.2070203@gmail.com> <1303977639.25988.1447.camel@localhost.localdomain> <20110428110658.GA26816@wavehammer.waldi.eu.org> <1303990128.25988.1570.camel@localhost.localdomain> <20110428122719.GA27897@wavehammer.waldi.eu.org> <1304000458.25988.1731.camel@localhost.localdomain> <20110429110808.GA14859@wavehammer.waldi.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110429110808.GA14859@wavehammer.waldi.eu.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Bastian Blank Cc: "pkg-xen-devel@lists.alioth.debian.org" , xen-devel List-Id: xen-devel@lists.xenproject.org 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 --- 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.