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] xl: Make blktap support optional

To: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: Make blktap support optional
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 16 Aug 2010 16:38:37 +0100
Cc: Ian@xxxxxxxxxxxxxxxxxxxxxxxx, Christoph Egger <Christoph.Egger@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Mon, 16 Aug 2010 08:39:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1281972022.18490.418.camel@xxxxxxxxxxxxxxxxxxxxxx>
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>
References: <201008131606.24873.Christoph.Egger@xxxxxxx> <1281972022.18490.418.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 16 Aug 2010, Gianni Tedesco wrote:
> On Fri, 2010-08-13 at 15:06 +0100, Christoph Egger wrote:
> > diff -r 2760576b0d7c -r 9996d4f06e70 tools/libxl/libxl_blktap2.c
> > --- /dev/null
> > +++ b/tools/libxl/libxl_blktap2.c
> > @@ -0,0 +1,51 @@
> > +/*
> > + * Copyright (C) 2010      Advanced Micro Devices
> > + * Author Christoph Egger <Christoph.Egger@xxxxxxx>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU Lesser General Public License as published
> > + * by the Free Software Foundation; version 2.1 only.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU Lesser General Public License for more details.
> > + */
> > +
> > +#include "libxl.h"
> > +#include "libxl_osdeps.h"
> > +#include "libxl_internal.h"
> > +
> > +#include "tap-ctl.h"
> > +
> > +int libxl_blktap_enabled(libxl_ctx *ctx)
> > +{
> > +    const char *msg;
> > +    return !tap_ctl_check(&msg);
> > +}
> > +
> > +const char *libxl_blktap_devpath(libxl_ctx *ctx,
> > +                                 const char *disk,
> > +                                 libxl_disk_phystype phystype)
> > +{
> > +    const char *type;
> > +    char *params, *devname;
> > +    int minor, err;
> > +
> > +    type = device_disk_string_of_phystype(phystype);
> > +    minor = tap_ctl_find_minor(type, disk);
> > +    if (minor >= 0) {
> > +        devname = libxl_sprintf(ctx, "/dev/xen/blktap-2/tapdev%d", minor);
> > +        if (devname)
> > +            return devname;
> > +    }
> 
> This actually breaks the build on linux. It's because this part of the
> patch needs a re-base since libxl_sprintf() etc. no longer takes a ctx
> argument. You will need to initialise a gc to do the libxl_sprintf() and
> then strdup() the result for the caller. The parts where you patched out
> of libxl.c had equivalent changes.
> 

considering that these are internal function, I'll pass a libxl_gc
instead of a libxl_ctx.

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

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