[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools: add closure to xc_domain_save switch_qemu_logdirty callback



On Tue, 12 Oct 2010, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@xxxxxxxxxx>
> # Date 1286899422 -3600
> # Node ID 92be1317280b14e63b381285cdf342dfae014e66
> # Parent  372959917c012db7d90aad0626a4af6b8f9b186f
> tools: add closure to xc_domain_save switch_qemu_logdirty callback
> 
> Also move the function into struct save_callbacks with the others.
> 
> Use this in libxl to pass the save context to
> libxl__domain_suspend_common_switch_qemu_logdirty allowing us to reuse
> the parent's xenstore handle, gc context etc.
> 
> Also add an apparently missing libxl__free_all to
> libxl__domain_suspend_common.
> 
> (Now that switch_qemu_logdirty takes a closure it's not clear if
> checkpoint can be changed to use the callback rather than doing the
> switch itself and implementing a nop callback, Branden?)
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
> Change from v1:
>   Compile test from missed call to xc_domain_save in
>   tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
> 
> diff -r 372959917c01 -r 92be1317280b tools/libxc/xc_domain_save.c
> --- a/tools/libxc/xc_domain_save.c    Tue Oct 12 17:03:42 2010 +0100
> +++ b/tools/libxc/xc_domain_save.c    Tue Oct 12 17:03:42 2010 +0100
> @@ -879,7 +879,7 @@ int xc_domain_save(xc_interface *xch, in
>  int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t 
> max_iters,
>                     uint32_t max_factor, uint32_t flags,
>                     struct save_callbacks* callbacks,
> -                   int hvm, void (*switch_qemu_logdirty)(int, unsigned))
> +                   int hvm)
>  {
>      xc_dominfo_t info;
>      DECLARE_DOMCTL;
> @@ -1015,7 +1015,7 @@ int xc_domain_save(xc_interface *xch, in
>  
>          /* Enable qemu-dm logging dirty pages to xen */
>          if ( hvm )
> -            switch_qemu_logdirty(dom, 1);
> +            callbacks->switch_qemu_logdirty(dom, 1, callbacks->data);
>      }
>      else
>      {
> @@ -1876,7 +1876,7 @@ int xc_domain_save(xc_interface *xch, in
>                                 NULL, 0, NULL, 0, NULL) < 0 )
>              DPRINTF("Warning - couldn't disable shadow mode");
>          if ( hvm )
> -            switch_qemu_logdirty(dom, 0);
> +            callbacks->switch_qemu_logdirty(dom, 0, callbacks->data);
>      }
>  
>      if ( live_shinfo )

I think that at the beginning of xc_domain_save we should check if
callbacks->switch_qemu_logdirty is NULL and print an error an return in
that case.



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.