mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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: ❌ command not found
This commit is contained in:
1 parent
0d6bfee094
commit
d4e4e3abee
3 files changed
+8
-10
No files matched your search
@@ -65,17 +65,12 @@ static int shutting_down = SHUTDOWN_INVALID;
|
||||
#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();
|
||||
#else
|
||||
@@ -108,7 +103,8 @@ static int __do_suspend(void *ignore)
|
||||
|
||||
#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
|
||||
|
||||
@@ -368,7 +368,7 @@ static void blkif_free(struct blkfront_info *info)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 @@ int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
|
||||
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 @@ int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
|
||||
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;
|
||||
}
|
||||
|
||||