ia64/xen-unstable

changeset 18446:a7586ec158d0

xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 08 11:13:03 2008 +0100 (2008-09-08)
parents b146f0cf3b8b
children f2bd9bbb0593
files tools/libxc/ia64/xc_ia64_linux_save.c tools/libxc/xc_domain_save.c tools/libxc/xenguest.h tools/xcutils/xc_save.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_linux_save.c	Mon Sep 08 10:55:09 2008 +0100
     1.2 +++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Mon Sep 08 11:13:03 2008 +0100
     1.3 @@ -53,12 +53,12 @@ static inline void set_bit(int nr, volat
     1.4  }
     1.5  
     1.6  static int
     1.7 -suspend_and_state(int (*suspend)(int), int xc_handle, int io_fd,
     1.8 +suspend_and_state(int (*suspend)(void), int xc_handle, int io_fd,
     1.9                    int dom, xc_dominfo_t *info)
    1.10  {
    1.11      int i = 0;
    1.12  
    1.13 -    if (!(*suspend)(dom)) {
    1.14 +    if (!(*suspend)()) {
    1.15          ERROR("Suspend request failed");
    1.16          return -1;
    1.17      }
    1.18 @@ -406,7 +406,7 @@ out:
    1.19  
    1.20  int
    1.21  xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
    1.22 -               uint32_t max_factor, uint32_t flags, int (*suspend)(int),
    1.23 +               uint32_t max_factor, uint32_t flags, int (*suspend)(void),
    1.24                 int hvm, void *(*init_qemu_maps)(int, unsigned),
    1.25                 void (*qemu_flip_buffer)(int, int))
    1.26  {
     2.1 --- a/tools/libxc/xc_domain_save.c	Mon Sep 08 10:55:09 2008 +0100
     2.2 +++ b/tools/libxc/xc_domain_save.c	Mon Sep 08 11:13:03 2008 +0100
     2.3 @@ -338,12 +338,12 @@ static int analysis_phase(int xc_handle,
     2.4  }
     2.5  
     2.6  
     2.7 -static int suspend_and_state(int (*suspend)(int), int xc_handle, int io_fd,
     2.8 +static int suspend_and_state(int (*suspend)(void), int xc_handle, int io_fd,
     2.9                               int dom, xc_dominfo_t *info)
    2.10  {
    2.11      int i = 0;
    2.12  
    2.13 -    if ( !(*suspend)(dom) )
    2.14 +    if ( !(*suspend)() )
    2.15      {
    2.16          ERROR("Suspend request failed");
    2.17          return -1;
    2.18 @@ -796,7 +796,7 @@ static xen_pfn_t *map_and_save_p2m_table
    2.19  
    2.20  
    2.21  int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
    2.22 -                   uint32_t max_factor, uint32_t flags, int (*suspend)(int),
    2.23 +                   uint32_t max_factor, uint32_t flags, int (*suspend)(void),
    2.24                     int hvm, void *(*init_qemu_maps)(int, unsigned), 
    2.25                     void (*qemu_flip_buffer)(int, int))
    2.26  {
     3.1 --- a/tools/libxc/xenguest.h	Mon Sep 08 10:55:09 2008 +0100
     3.2 +++ b/tools/libxc/xenguest.h	Mon Sep 08 11:13:03 2008 +0100
     3.3 @@ -25,7 +25,7 @@
     3.4   */
     3.5  int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
     3.6                     uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */,
     3.7 -                   int (*suspend)(int domid), int hvm,
     3.8 +                   int (*suspend)(void), int hvm,
     3.9                     void *(*init_qemu_maps)(int, unsigned),  /* HVM only */
    3.10                     void (*qemu_flip_buffer)(int, int));     /* HVM only */
    3.11  
     4.1 --- a/tools/xcutils/xc_save.c	Mon Sep 08 10:55:09 2008 +0100
     4.2 +++ b/tools/xcutils/xc_save.c	Mon Sep 08 11:13:03 2008 +0100
     4.3 @@ -32,7 +32,7 @@ static struct suspendinfo {
     4.4   * Issue a suspend request through stdout, and receive the acknowledgement
     4.5   * from stdin.  This is handled by XendCheckpoint in the Python layer.
     4.6   */
     4.7 -static int compat_suspend(int domid)
     4.8 +static int compat_suspend(void)
     4.9  {
    4.10      char ans[30];
    4.11  
    4.12 @@ -43,7 +43,7 @@ static int compat_suspend(int domid)
    4.13              !strncmp(ans, "done\n", 5));
    4.14  }
    4.15  
    4.16 -static int suspend_evtchn_release(int xc, int domid)
    4.17 +static int suspend_evtchn_release(void)
    4.18  {
    4.19      if (si.suspend_evtchn >= 0) {
    4.20  	xc_evtchn_unbind(si.xce, si.suspend_evtchn);
    4.21 @@ -107,7 +107,7 @@ static int suspend_evtchn_init(int xc, i
    4.22      return 0;
    4.23  
    4.24    cleanup:
    4.25 -    suspend_evtchn_release(xc, domid);
    4.26 +    suspend_evtchn_release();
    4.27  
    4.28      return -1;
    4.29  }
    4.30 @@ -115,7 +115,7 @@ static int suspend_evtchn_init(int xc, i
    4.31  /**
    4.32   * Issue a suspend request to a dedicated event channel in the guest, and
    4.33   * receive the acknowledgement from the subscribe event channel. */
    4.34 -static int evtchn_suspend(int domid)
    4.35 +static int evtchn_suspend(void)
    4.36  {
    4.37      int rc;
    4.38  
    4.39 @@ -144,12 +144,12 @@ static int evtchn_suspend(int domid)
    4.40      return 1;
    4.41  }
    4.42  
    4.43 -static int suspend(int domid)
    4.44 +static int suspend(void)
    4.45  {
    4.46      if (si.suspend_evtchn >= 0)
    4.47 -	return evtchn_suspend(domid);
    4.48 +	return evtchn_suspend();
    4.49  
    4.50 -    return compat_suspend(domid);
    4.51 +    return compat_suspend();
    4.52  }
    4.53  
    4.54  /* For HVM guests, there are two sources of dirty pages: the Xen shadow
    4.55 @@ -214,7 +214,7 @@ static void qemu_flip_buffer(int domid, 
    4.56          goto read_again;
    4.57  }
    4.58  
    4.59 -static void * init_qemu_maps(int domid, unsigned int bitmap_size)
    4.60 +static void *init_qemu_maps(int domid, unsigned int bitmap_size)
    4.61  {
    4.62      key_t key;
    4.63      char key_ascii[17] = {0,};
    4.64 @@ -304,7 +304,7 @@ main(int argc, char **argv)
    4.65                           &suspend, !!(flags & XCFLAGS_HVM),
    4.66                           &init_qemu_maps, &qemu_flip_buffer);
    4.67  
    4.68 -    suspend_evtchn_release(xc_fd, domid);
    4.69 +    suspend_evtchn_release();
    4.70  
    4.71      xc_interface_close(xc_fd);
    4.72