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

Re: [Xen-devel] [PATCH for-4.6] libxl, hotplug/Linux: default to phy backend for raw format file

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.

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)

> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> ---
>  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=$(xenstore_read_default "$XENBUS_PATH/type" 'MISSING')
> +p=$(xenstore_read "$XENBUS_PATH/params")
> +mode=$(xenstore_read "$XENBUS_PATH/mode")
> +if [ -b "$p" ]; then
> +    truetype="phy"
> +elif [ -f "$p" ]; then
> +    truetype="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.


Xen-devel mailing list



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