From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFT] kvm host suspend/resume Date: Wed, 31 Jan 2007 12:32:49 +0200 Message-ID: <45C07051.60003@qumranet.com> References: <45BC96BB.5080203@qumranet.com> <45BF9FDB.6060302@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080509000000000707030600" Cc: kvm-devel To: Jeremy Katz Return-path: In-Reply-To: <45BF9FDB.6060302-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------080509000000000707030600 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------080509000000000707030600 Content-Type: text/x-patch; name="hotplug-hotfix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hotplug-hotfix.patch" 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; --------------080509000000000707030600 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --------------080509000000000707030600 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------080509000000000707030600--