ia64/xen-unstable

changeset 6483:834466f56fc3

Fix save/restore (for SMP guests in particularl); the blkfront suspend code
was failing to unbind its irq handler correctly which (on SMP) caused the
guest to BUG() on resume when trying to request its callfunc_irq. Plus a
few small cosmetic changes.

Signed-off-by: Steven Hand <steven@xensource.com>
/bin/bash: :x: command not found
author shand@ubuntu.eng.hq.xensource.com
date Mon Aug 29 19:20:55 2005 -0800 (2005-08-29)
parents b3785cbb723b
children e69cbfee4011
files linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c tools/libxc/xc_linux_restore.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Mon Aug 29 17:40:47 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Mon Aug 29 19:20:55 2005 -0800
     1.3 @@ -65,17 +65,12 @@ static int shutting_down = SHUTDOWN_INVA
     1.4  #define cpu_up(x) (-EOPNOTSUPP)
     1.5  #endif
     1.6  
     1.7 -#ifdef CONFIG_SMP
     1.8 -#endif
     1.9  
    1.10  static int __do_suspend(void *ignore)
    1.11  {
    1.12      int i, j;
    1.13      suspend_record_t *suspend_record;
    1.14  
    1.15 -    /* Hmmm... a cleaner interface to suspend/resume blkdevs would be nice. */
    1.16 -	/* XXX SMH: yes it would :-( */	
    1.17 -
    1.18  #ifdef CONFIG_XEN_USB_FRONTEND
    1.19      extern void usbif_resume();
    1.20  #else
    1.21 @@ -108,7 +103,8 @@ static int __do_suspend(void *ignore)
    1.22  
    1.23  #if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
    1.24      if (num_online_cpus() > 1) {
    1.25 -	printk(KERN_WARNING "Can't suspend SMP guests without CONFIG_HOTPLUG_CPU\n");
    1.26 +	printk(KERN_WARNING 
    1.27 +               "Can't suspend SMP guests without CONFIG_HOTPLUG_CPU\n");
    1.28  	return -EOPNOTSUPP;
    1.29      }
    1.30  #endif
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 29 17:40:47 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 29 19:20:55 2005 -0800
     2.3 @@ -368,7 +368,7 @@ static void blkif_free(struct blkfront_i
     2.4  		free_page((unsigned long)info->ring.sring);
     2.5  		info->ring.sring = NULL;
     2.6  	}
     2.7 -	unbind_evtchn_from_irqhandler(info->evtchn, NULL);
     2.8 +	unbind_evtchn_from_irqhandler(info->evtchn, info); 
     2.9  	info->evtchn = 0;
    2.10  }
    2.11  
     3.1 --- a/tools/libxc/xc_linux_restore.c	Mon Aug 29 17:40:47 2005 +0000
     3.2 +++ b/tools/libxc/xc_linux_restore.c	Mon Aug 29 19:20:55 2005 -0800
     3.3 @@ -19,13 +19,13 @@
     3.4  #define DEBUG 0
     3.5  
     3.6  #if 1
     3.7 -#define ERR(_f, _a...) fprintf ( stderr, _f , ## _a ); fflush(stderr)
     3.8 +#define ERR(_f, _a...) do { fprintf ( stderr, _f , ## _a ); fflush(stderr); } while(0)
     3.9  #else
    3.10  #define ERR(_f, _a...) ((void)0)
    3.11  #endif
    3.12  
    3.13  #if DEBUG
    3.14 -#define DPRINTF(_f, _a...) fprintf ( stdout, _f , ## _a ); fflush(stdout)
    3.15 +#define DPRINTF(_f, _a...) do { fprintf ( stdout, _f , ## _a ); fflush(stdout); } while (0)
    3.16  #else
    3.17  #define DPRINTF(_f, _a...) ((void)0)
    3.18  #endif
    3.19 @@ -103,7 +103,7 @@ int xc_linux_restore(int xc_handle, int 
    3.20      struct mmuext_op pin[MAX_PIN_BATCH];
    3.21      unsigned int nr_pins = 0;
    3.22  
    3.23 -    DPRINTF("xc_linux_restore start\n");
    3.24 +    DPRINTF("xc_linux_restore start: nr_pfns = %lx\n", nr_pfns);
    3.25  
    3.26      if (mlock(&ctxt, sizeof(ctxt))) {
    3.27          /* needed for when we do the build dom0 op, 
    3.28 @@ -152,6 +152,8 @@ int xc_linux_restore(int xc_handle, int 
    3.29      err = xc_domain_memory_increase_reservation(xc_handle, dom,
    3.30                                                  nr_pfns * PAGE_SIZE / 1024);
    3.31      if (err != 0) {
    3.32 +        ERR("Failed to increate reservation by %lx\n", 
    3.33 +            nr_pfns * PAGE_SIZE / 1024); 
    3.34          errno = ENOMEM;
    3.35          goto out;
    3.36      }