From: Ian Campbell Subject: Re: [PATCH 01/19] libxc: xc_domain_restore, make toolstack_restore const-correct Date: Tue, 12 Jun 2012 16:15:08 +0100 Message-ID: <1339514108.24104.82.camel@zakaz.uk.xensource.com> References: <1339176870-32652-1-git-send-email-ian.jackson@eu.citrix.com> <1339176870-32652-2-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1339176870-32652-2-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2012-06-08 at 18:34 +0100, Ian Jackson wrote: > Update the one provider of this callback, in libxl. > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell > Changes in v3: > * No longer introduce function pointer typedefs into the libxc API. Thanks! > --- > tools/libxc/xenguest.h | 2 +- > tools/libxl/libxl_dom.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h > index 91d53f7..707e31c 100644 > --- a/tools/libxc/xenguest.h > +++ b/tools/libxc/xenguest.h > @@ -92,7 +92,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter > /* callbacks provided by xc_domain_restore */ > struct restore_callbacks { > /* callback to restore toolstack specific data */ > - int (*toolstack_restore)(uint32_t domid, uint8_t *buf, > + int (*toolstack_restore)(uint32_t domid, const uint8_t *buf, > uint32_t size, void* data); > > /* to be provided as the last argument to each callback function */ > diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c > index 10f8c1f..677db1d 100644 > --- a/tools/libxl/libxl_dom.c > +++ b/tools/libxl/libxl_dom.c > @@ -467,13 +467,13 @@ static inline char *restore_helper(libxl__gc *gc, uint32_t domid, > domid, phys_offset, node); > } > > -static int libxl__toolstack_restore(uint32_t domid, uint8_t *buf, > +static int libxl__toolstack_restore(uint32_t domid, const uint8_t *buf, > uint32_t size, void *data) > { > libxl__gc *gc = (libxl__gc *) data; > libxl_ctx *ctx = gc->owner; > int i, ret; > - uint8_t *ptr = buf; > + const uint8_t *ptr = buf; > uint32_t count = 0, version = 0; > struct libxl__physmap_info* pi; > char *xs_path;