Jeremy Katz wrote:
Avi Kivity wrote:
I've committed kvm support for host suspend-to-disk (and hopefully
resume too). This means you can suspend your machine with running
vms, and resume it later will all vms returning to the saved state.
This should please laptop owners.
So testing with trunk (r4365) + 2.6.20-rc5-ish, I'm able to suspend
and resume with the modules loaded. Starting a guest after resume
gets the following oops in the host; guest is in the grub menu at that
point.
2.6.20-rc6 can't suspend my test machine (regardless of kvm), so this
possible fix is completely untested.
--
error compiling committee.c: too many arguments to function
Index: linux/drivers/kvm/kvm_main.c
===================================================================
--- linux/drivers/kvm/kvm_main.c (revision 4365)
+++ linux/drivers/kvm/kvm_main.c (working copy)
@@ -2113,6 +2113,16 @@
smp_call_function_single(cpu, kvm_arch_ops->hardware_disable,
NULL, 0, 1);
break;
+ }
+ return NOTIFY_OK;
+}
+
+static int kvm_cpu_hotplug2(struct notifier_block *notifier, unsigned long val,
+ void *v)
+{
+ int cpu = (long)v;
+
+ switch (val) {
case CPU_UP_PREPARE:
smp_call_function_single(cpu, kvm_arch_ops->hardware_enable,
NULL, 0, 1);
@@ -2126,6 +2136,11 @@
.priority = 20, /* must be > scheduler priority */
};
+static struct notifier_block kvm_cpu_notifier2 = {
+ .notifier_call = kvm_cpu_hotplug2,
+ .priority = 2, /* must be < scheduler priority */
+};
+
static __init void kvm_init_debug(void)
{
struct kvm_stats_debugfs_item *p;
@@ -2197,6 +2212,7 @@
on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1);
r = register_cpu_notifier(&kvm_cpu_notifier);
+ register_cpu_notifier(&kvm_cpu_notifier2);
if (r)
goto out_free_1;
register_reboot_notifier(&kvm_reboot_notifier);
@@ -2226,6 +2242,7 @@
out_free_2:
unregister_reboot_notifier(&kvm_reboot_notifier);
unregister_cpu_notifier(&kvm_cpu_notifier);
+ unregister_cpu_notifier(&kvm_cpu_notifier2);
out_free_1:
on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1);
kvm_arch_ops->hardware_unsetup();
@@ -2239,6 +2256,7 @@
sysdev_class_unregister(&kvm_sysdev_class);
unregister_reboot_notifier(&kvm_reboot_notifier);
unregister_cpu_notifier(&kvm_cpu_notifier);
+ unregister_cpu_notifier(&kvm_cpu_notifier2);
on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1);
kvm_arch_ops->hardware_unsetup();
kvm_arch_ops = NULL;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel