xen_mm_unpin_all();
 }
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_HIBERNATION
 static int xen_suspend(void *data)
 {
        struct suspend_info *si = data;
 
        BUG_ON(!irqs_disabled());
 
-       err = sysdev_suspend(PMSG_SUSPEND);
+       err = sysdev_suspend(PMSG_FREEZE);
        if (err) {
                printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
                        err);
        }
 #endif
 
-       err = dpm_suspend_start(PMSG_SUSPEND);
+       err = dpm_suspend_start(PMSG_FREEZE);
        if (err) {
                printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
                goto out_thaw;
        printk(KERN_DEBUG "suspending xenstore...\n");
        xs_suspend();
 
-       err = dpm_suspend_noirq(PMSG_SUSPEND);
+       err = dpm_suspend_noirq(PMSG_FREEZE);
        if (err) {
                printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err);
                goto out_resume;
 
        err = stop_machine(xen_suspend, &si, cpumask_of(0));
 
-       dpm_resume_noirq(PMSG_RESUME);
+       dpm_resume_noirq(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
 
        if (err) {
                printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
        } else
                xs_suspend_cancel();
 
-       dpm_resume_end(PMSG_RESUME);
+       dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
 
        /* Make sure timer events get retriggered on all CPUs */
        clock_was_set();
 #endif
        shutting_down = SHUTDOWN_INVALID;
 }
-#endif /* CONFIG_PM_SLEEP */
+#endif /* CONFIG_HIBERNATION */
 
 struct shutdown_handler {
        const char *command;
                { "poweroff",   do_poweroff },
                { "halt",       do_poweroff },
                { "reboot",     do_reboot   },
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_HIBERNATION
                { "suspend",    do_suspend  },
 #endif
                {NULL, NULL},
 
 };
 
 static const struct dev_pm_ops xenbus_pm_ops = {
-       .suspend = xenbus_dev_suspend,
-       .resume  = xenbus_dev_resume,
-       .thaw  = xenbus_dev_cancel,
+       .suspend        = xenbus_dev_suspend,
+       .resume         = xenbus_dev_resume,
+       .freeze         = xenbus_dev_suspend,
+       .thaw           = xenbus_dev_cancel,
+       .restore        = xenbus_dev_resume,
 };
 
 static struct xen_bus_type xenbus_frontend = {