From: Ian Campbell Subject: Re: libxl_device.c, stat() and remote disks Date: Mon, 22 Apr 2013 18:03:39 +0100 Message-ID: <1366650219.20256.27.camel@zakaz.uk.xensource.com> References: <5175440D.8060201@eu.citrix.com> <1366641371.22143.68.camel@zakaz.uk.xensource.com> <51756B46.2000907@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51756B46.2000907@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dave Scott Cc: Roger Pau Monne , xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2013-04-22 at 17:54 +0100, Dave Scott wrote: > On 22/04/13 15:36, Ian Campbell wrote: > > On Mon, 2013-04-22 at 15:07 +0100, David Scott wrote: > >> Is it safe to remove the stat() from libxl_device.c? > > > > I expect it only makes sense when backendtype=phy and perhaps the > > disk->script check has served as an imperfect surrogate for that until > > now? > > > > Does changing > > } else if (!disk->script) { > > into > > } else if (disk->backendtype == ...PHY && !disk->script) { > > > > Work for you also? > > Yes, it works nicely against 4.2.1! The exact patch I applied was: > > --- tools/libxl/libxl_device.c.orig 2013-04-22 14:52:54.745001092 +0000 > +++ tools/libxl/libxl_device.c 2013-04-22 14:54:11.566001097 +0000 > @@ -236,7 +236,7 @@ > return ERROR_INVAL; > } > memset(&a.stab, 0, sizeof(a.stab)); > - } else if (!disk->script) { > + } else if (disk->backend == LIBXL_DISK_BACKEND_PHY && !disk->script) { > if (stat(disk->pdev_path, &a.stab)) { > LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Disk vdev=%s " > "failed to stat: %s", > > Would you like me to retest this against -unstable? Also would you like > me to 'git format-patch/send-email' or is it too trivial to bother? A changelog and a S-o-b should be sufficient, thanks. However, I think this code is probably broken for driver domains as well. I think it probably needs a disk->backend_domid check in addition to what's there -- if you wouldn't mind folding that into the patch that would be awesome. There's so many exclusions now I'm wondering if the stat is actually useful, oh well. I suppose it is still active in some of the more common cases. Ian,