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 5 of 6] libxl: add support for NetBSD to use disk

To: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 5 of 6] libxl: add support for NetBSD to use disk images as a PHY backend
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 22 Sep 2011 14:37:05 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 22 Sep 2011 06:37:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <a5c9a6083bef9d4789a0.1316692872@loki>
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: <patchbomb.1316692867@loki> <a5c9a6083bef9d4789a0.1316692872@loki>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-09-22 at 13:01 +0100, Roger Pau Monne wrote:
> # HG changeset patch
> # User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
> # Date 1316692503 -7200
> # Node ID a5c9a6083bef9d4789a0194389db234740cd6005
> # Parent  d5cca9e3b5d3576073a543d0305e8f0d9dc9beeb
> libxl: add support for NetBSD to use disk images as a PHY backend
> 
> Add a NetBSD special case to use images as PHY disk devices, which can be 
> attached using the regular block hotplug script.
> 
> Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>

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

I think the "return 0"s in this function ought to be
LIBXL_DISK_BACKEND_UNKNOWN for clarity but that's a pre-existing
problem.

> 
> diff -r d5cca9e3b5d3 -r a5c9a6083bef tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c      Thu Sep 22 13:54:55 2011 +0200
> +++ b/tools/libxl/libxl_device.c      Thu Sep 22 13:55:03 2011 +0200
> @@ -136,15 +136,20 @@ static int disk_try_backend(disk_try_bac
>                a->disk->format == LIBXL_DISK_FORMAT_EMPTY)) {
>              goto bad_format;
>          }
> -        if (a->disk->format != LIBXL_DISK_FORMAT_EMPTY &&
> -            !S_ISBLK(a->stab.st_mode)) {
> -            LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend phy"
> -                       " unsuitable as phys path not a block device",
> -                       a->disk->vdev);
> -            return 0;
> -        }
> -
> -        return backend;
> +        if (S_ISBLK(a->stab.st_mode))
> +            return backend;
> +#ifdef HAVE_PHY_BACKEND_FILE_SUPPORT
> +        if (S_ISREG(a->stab.st_mode))
> +            return backend;
> +        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend phy"
> +            " unsuitable as phys path not a block device or"
> +            " raw image", a->disk->vdev);
> +#else
> +        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend phy"
> +            " unsuitable as phys path not a block device",
> +            a->disk->vdev);
> +#endif
> +        return 0;
>  
>      case LIBXL_DISK_BACKEND_TAP:
>          if (!libxl__blktap_enabled(a->gc)) {
> diff -r d5cca9e3b5d3 -r a5c9a6083bef tools/libxl/libxl_osdeps.h
> --- a/tools/libxl/libxl_osdeps.h      Thu Sep 22 13:54:55 2011 +0200
> +++ b/tools/libxl/libxl_osdeps.h      Thu Sep 22 13:55:03 2011 +0200
> @@ -25,6 +25,7 @@
>  
>  #if defined(__NetBSD__) || defined(__OpenBSD__)
>  #include <util.h>
> +#define HAVE_PHY_BACKEND_FILE_SUPPORT
>  #elif defined(__linux__)
>  #include <pty.h>
>  #elif defined(__sun__)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

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