|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH] xl: Make blktap support optional
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
|
|
|
|
|