WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Ian Campbell <ian.campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] tools: add closure to xc_domain_save switch_qemu_logdirty callback
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 13 Oct 2010 12:14:11 +0100
Cc: Ian, Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 13 Oct 2010 04:15:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <92be1317280b14e63b38.1286899510@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <92be1317280b14e63b38.1286899510@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
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