WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 07/14] libxl: disks: Make LIBXL_DISK_BACKEND_UNKN

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 07/14] libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Fri, 13 May 2011 11:38:34 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 13 May 2011 03:39:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1305211004-31687-8-git-send-email-ian.jackson@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <1305211004-31687-1-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-2-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-3-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-4-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-5-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-6-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-7-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1305211004-31687-8-git-send-email-ian.jackson@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-05-12 at 15:36 +0100, Ian Jackson wrote:
> libxl callers should not be required to specify the backend if they
> don't want to.  So LIBXL_DISK_BACKEND_UNKNOWN should instruct libxl to
> choose the backend for itself.

I guess the selection of LIBXL_DISK_BACKEND_TAP was chosen to give the
greatest coverage as a stop gap measure until more smarts arrive? (It'll
fall back to QDISK as necessary too, which is nice). 

> 
> More thorough fixes for the disk handling will follow.
> 
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

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

> ---
>  tools/libxl/libxl.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index fe012cb..73fc3e9 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -989,6 +989,21 @@ int libxl_device_disk_add(libxl_ctx *ctx, uint32_t 
> domid, libxl_device_disk *dis
>      device.domid = domid;
>      device.kind = DEVICE_VBD;
>  
> +
> +    /*
> +     * Fixing the incoming backend type to try to decide on which
> +     * backend to use.  Unfortunately at the moment this code is
> +     * utterly broken, but it more or less works.
> +     */
> +
> +    /*
> +     * Backend type UNKNOWN should mean "caller does not want to specify",
> +     * not "break pointlessely".  (Callers should not be required to
> +     * specify the backend if they don't want to.)
> +     */
> +    if (disk->backend == LIBXL_DISK_BACKEND_UNKNOWN)
> +        disk->backend = LIBXL_DISK_BACKEND_TAP;
> +
>      /* If blktap is not available then fallback to qdisk */
>      if (disk->backend == LIBXL_DISK_BACKEND_TAP && 
> !libxl__blktap_enabled(&gc))
>          disk->backend = LIBXL_DISK_BACKEND_QDISK;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>