[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] libxc: introduce XC_SAVE_ID_TOOLSTACK
On Fri, 2012-01-20 at 11:18 +0000, Stefano Stabellini wrote: > diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c > index a6bb894..3d11c39 100644 > --- a/tools/libxc/xc_domain_save.c > +++ b/tools/libxc/xc_domain_save.c > @@ -1676,6 +1676,22 @@ int xc_domain_save(xc_interface *xch, int io_fd, > uint32_t dom, uint32_t max_iter > } > } > > + if ( callbacks != NULL && callbacks->toolstack_save != NULL ) > + { > + int id = XC_SAVE_ID_TOOLSTACK; > + uint8_t *buf; > + uint32_t len; > + > + if ( callbacks->toolstack_save(dom, &buf, &len, callbacks->data) < 0 > ) > + { > + PERROR("Error calling toolstack_save"); > + goto out; > + } > + wrexact(io_fd, &id, sizeof(id)); > + wrexact(io_fd, &len, sizeof(len)); > + wrexact(io_fd, buf, len); Where is buf free'd? You say below "callee allocates and frees the buffer" but there is no way that can be the case since the caller uses the buffer after the callback. I think it has to be callee-alloc, caller-free (perhaps callee-free on error). > + } > + > if ( !callbacks->checkpoint ) > { > /* > diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h > index 4475ee9..8120715 100644 > --- a/tools/libxc/xenguest.h > +++ b/tools/libxc/xenguest.h > @@ -44,6 +44,13 @@ struct save_callbacks { > /* Enable qemu-dm logging dirty pages to xen */ > int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* > HVM only */ > > + /* Save toolstack specific data > + * @param buf the buffer with the data to be saved > + * @param len the length of the buffer > + * The callee allocates and frees the buffer. > + */ > + int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void > *data); > + > /* to be provided as the last argument to each callback function */ > void* data; > }; Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |