From: Wei Liu Subject: Re: [PATCH for-4.6] libxl, hotplug/Linux: default to phy backend for raw format file Date: Thu, 8 Jan 2015 16:07:33 +0000 Message-ID: <20150108160733.GV28680@zion.uk.xensource.com> References: <1417020935-2934-1-git-send-email-wei.liu2@citrix.com> <1420726062.19787.89.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1420726062.19787.89.camel@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: Ian Campbell Cc: Wei Liu , Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org, Roger Pau =?iso-8859-1?Q?Monn=E9?= List-Id: xen-devel@lists.xenproject.org On Thu, Jan 08, 2015 at 02:07:42PM +0000, Ian Campbell wrote: > On Wed, 2014-11-26 at 16:55 +0000, Wei Liu wrote: > > Modify libxl and hotplug script to allow raw format file to use phy > > backend. > > = > > The block script now tests the path and determine the actual type of > > file (block device or regular file) then use the actual type to > > determine which branch to run. > > = > > With these changes, plus the current ordering of backend preference (phy > > > qdisk > tap), we will use phy backend for raw format file by default. > = > http://lists.xen.org/archives/html/xen-devel/2012-04/msg00077.html > includes (in the quotes, Stefano's reply is about something else but has > conveniently trimmed most of the other uninteresting stuff): > use /dev/loop+blkback. This requires loop driver AIO and > O_DIRECT patches which are not (AFAIK) yet upstream. > = > and I have it in my mind that using /dev/loop+blkback is somehow unsafe, > for reasons relating to crash consistency and the proper implementation > (in /dev/loop, blkback is good I think) of barriers and such, e.g. > relating to whether data is really on the platter or not when we've to > the frontend that it is (which is critical for proper operation of > journalling file systems). > = > It's entirely possible that I'm either plain wrong or a decade out of > date on this though. CC-ing Konrad in case he has any insights as > blkback maintainer (I think, MAINTAINERS doesn't have a specific entry) > = Too bad, as far as I can tell AIO and O_DIRECT are still missing in loop device. I guess we will have to wait until those two things are upstreamed. Wei. > > = > > Signed-off-by: Wei Liu > > Cc: Ian Campbell > > Cc: Stefano Stabellini > > Cc: Roger Pau Monn=E9 > > Cc: Ian Jackson > > --- > > tools/hotplug/Linux/block | 16 +++++++++------- > > tools/libxl/libxl.c | 6 +++--- > > tools/libxl/libxl_device.c | 2 ++ > > tools/libxl/libxl_linux.c | 6 +++--- > > 4 files changed, 17 insertions(+), 13 deletions(-) > > = > > diff --git a/tools/hotplug/Linux/block b/tools/hotplug/Linux/block > > index da26e22..8d2ee9d 100644 > > --- a/tools/hotplug/Linux/block > > +++ b/tools/hotplug/Linux/block > > @@ -206,6 +206,13 @@ and so cannot be mounted ${m2}${when}." > > = > > = > > t=3D$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING') > > +p=3D$(xenstore_read "$XENBUS_PATH/params") > > +mode=3D$(xenstore_read "$XENBUS_PATH/mode") > > +if [ -b "$p" ]; then > > + truetype=3D"phy" > > +elif [ -f "$p" ]; then > > + truetype=3D"file" > > +fi > = > IIRC xend used to write file or phy to the type node as appropriate. I'm > unsure if that was in some way better than this approach, and perhaps > libxl doesn't even have the right information to hand. > = > Anyway, I just mention it for completeness, ignore it if you like. > = > Ian.