Avi Kivity wrote:
Jeremy Katz wrote:
On Wed, 2007-01-31 at 12:32 +0200, Avi Kivity wrote:
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.

Failure looks basically the same.  Will try to do some more
investigation later today.

Looks like ->hardware_enable() was not called for some reason. Sprinkling printks in the cpu hotplug and resume callbacks will help.

Multiple things failing here together.

1) With the versioning of Fedora kernels, things were falling back to the compat version of smp_call_function_single which then doesn't seem to work properly (->hardware_disable() and ->hardware_enable() never get called AFAICT)

2) Switching to use the real smp_call_function_single, I get an oops on suspend since we're trying to run code on the dead cpu. Attached patch makes it so that we do ->hardware_enable() and ->hardware_disable() when the cpu is in a functioning state. With it, I can suspend/resume successfully with no guests running. With a guest running, it's a bit of a toss-up. But one step at a time :)

Signed-off-by: Jeremy Katz <[EMAIL PROTECTED]>

Jeremy
Index: kvm_main.c
===================================================================
--- kvm_main.c	(revision 4369)
+++ kvm_main.c	(working copy)
@@ -2107,13 +2107,15 @@
 	int cpu = (long)v;
 
 	switch (val) {
-	case CPU_DEAD:
+	case CPU_DOWN_PREPARE:
 	case CPU_UP_CANCELED:
+		printk(KERN_INFO, "kvm: disabling virtualization on CPU%d\n", cpu);
 		decache_vcpus_on_cpu(cpu);
 		smp_call_function_single(cpu, kvm_arch_ops->hardware_disable,
 					 NULL, 0, 1);
 		break;
-	case CPU_UP_PREPARE:
+	case CPU_ONLINE:
+		printk(KERN_INFO, "kvm: enabling virtualization on CPU%d\n", cpu);
 		smp_call_function_single(cpu, kvm_arch_ops->hardware_enable,
 					 NULL, 0, 1);
 		break;
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to