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

[Xen-changelog] Fix save/restore (for SMP guests in particularl); the blkfront suspend code



# HG changeset patch
# User shand@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 834466f56fc3dbfda8e431604169253d51c3cf3e
# Parent  b3785cbb723b8b355c1282232de0bd1cfbfb3556
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@xxxxxxxxxxxxx> 
/bin/bash: :x: command not found

diff -r b3785cbb723b -r 834466f56fc3 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Aug 29 17:40:47 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Tue Aug 30 03:20:55 2005
@@ -65,16 +65,11 @@
 #define cpu_up(x) (-EOPNOTSUPP)
 #endif
 
-#ifdef CONFIG_SMP
-#endif
 
 static int __do_suspend(void *ignore)
 {
     int i, j;
     suspend_record_t *suspend_record;
-
-    /* Hmmm... a cleaner interface to suspend/resume blkdevs would be nice. */
-       /* XXX SMH: yes it would :-( */ 
 
 #ifdef CONFIG_XEN_USB_FRONTEND
     extern void usbif_resume();
@@ -108,7 +103,8 @@
 
 #if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
     if (num_online_cpus() > 1) {
-       printk(KERN_WARNING "Can't suspend SMP guests without 
CONFIG_HOTPLUG_CPU\n");
+       printk(KERN_WARNING 
+               "Can't suspend SMP guests without CONFIG_HOTPLUG_CPU\n");
        return -EOPNOTSUPP;
     }
 #endif
diff -r b3785cbb723b -r 834466f56fc3 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Aug 29 
17:40:47 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Tue Aug 30 
03:20:55 2005
@@ -368,7 +368,7 @@
                free_page((unsigned long)info->ring.sring);
                info->ring.sring = NULL;
        }
-       unbind_evtchn_from_irqhandler(info->evtchn, NULL);
+       unbind_evtchn_from_irqhandler(info->evtchn, info); 
        info->evtchn = 0;
 }
 
diff -r b3785cbb723b -r 834466f56fc3 tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Mon Aug 29 17:40:47 2005
+++ b/tools/libxc/xc_linux_restore.c    Tue Aug 30 03:20:55 2005
@@ -19,13 +19,13 @@
 #define DEBUG 0
 
 #if 1
-#define ERR(_f, _a...) fprintf ( stderr, _f , ## _a ); fflush(stderr)
+#define ERR(_f, _a...) do { fprintf ( stderr, _f , ## _a ); fflush(stderr); } 
while(0)
 #else
 #define ERR(_f, _a...) ((void)0)
 #endif
 
 #if DEBUG
-#define DPRINTF(_f, _a...) fprintf ( stdout, _f , ## _a ); fflush(stdout)
+#define DPRINTF(_f, _a...) do { fprintf ( stdout, _f , ## _a ); 
fflush(stdout); } while (0)
 #else
 #define DPRINTF(_f, _a...) ((void)0)
 #endif
@@ -103,7 +103,7 @@
     struct mmuext_op pin[MAX_PIN_BATCH];
     unsigned int nr_pins = 0;
 
-    DPRINTF("xc_linux_restore start\n");
+    DPRINTF("xc_linux_restore start: nr_pfns = %lx\n", nr_pfns);
 
     if (mlock(&ctxt, sizeof(ctxt))) {
         /* needed for when we do the build dom0 op, 
@@ -152,6 +152,8 @@
     err = xc_domain_memory_increase_reservation(xc_handle, dom,
                                                 nr_pfns * PAGE_SIZE / 1024);
     if (err != 0) {
+        ERR("Failed to increate reservation by %lx\n", 
+            nr_pfns * PAGE_SIZE / 1024); 
         errno = ENOMEM;
         goto out;
     }

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


 


Rackspace

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