On Fri, 11 Jun 2010, Daniel Stodden wrote:
> On Fri, 2010-06-11 at 06:38 -0400, Stefano Stabellini wrote:
>
> >
> > This code doesn't compile:
> >
> > libxl_sprintf(ctx, devname);
> >
> > In any case you can just use libxl_ptr_add to add a ptr to libxl memory
> > tracking.
>
> It compiles for me. Please fix it and send an update.
Sure, this is the fix:
---
diff -r 630956366c2c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Fri Jun 11 09:35:25 2010 +0100
+++ b/tools/libxl/libxl.c Fri Jun 11 12:19:33 2010 +0100
@@ -1253,15 +1253,13 @@
static char *make_blktap2_device(struct libxl_ctx *ctx,
const char *name, const char *type)
{
- char *params, *devname = NULL, *rv = NULL;
+ char *params, *devname = NULL;
int err;
params = libxl_sprintf(ctx, "%s:%s", type, name);
err = tap_ctl_create(params, &devname);
- if (!err) {
- rv = libxl_sprintf(ctx, devname);
- free(devname);
- }
- return rv;
+ if (!err)
+ libxl_ptr_add(ctx, devname);
+ return err ? NULL : devname;
}
int libxl_device_disk_add(struct libxl_ctx *ctx, uint32_t domid,
libxl_device_disk *disk)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|