From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: [PATCH 6/10] Trivial: Avoid hardware_disable predeclaration Date: Tue, 17 Jul 2007 23:17:55 +1000 Message-ID: <1184678275.10380.16.camel@localhost.localdomain> References: <1184677946.10380.4.camel@localhost.localdomain> <1184678060.10380.7.camel@localhost.localdomain> <1184678129.10380.10.camel@localhost.localdomain> <1184678171.10380.12.camel@localhost.localdomain> <1184678216.10380.14.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: In-Reply-To: <1184678216.10380.14.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@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 Don't pre-declare hardware_disable: shuffle the reboot hook down. Signed-off-by: Rusty Russell diff -r 1bfd3798620c drivers/kvm/kvm_main.c --- a/drivers/kvm/kvm_main.c Tue Jul 17 13:36:23 2007 +1000 +++ b/drivers/kvm/kvm_main.c Tue Jul 17 16:25:23 2007 +1000 @@ -53,8 +53,6 @@ static cpumask_t cpus_hardware_enabled; static cpumask_t cpus_hardware_enabled; struct kvm_arch_ops *kvm_arch_ops; - -static void hardware_disable(void *ignored); #define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x) @@ -2930,25 +2928,6 @@ static struct miscdevice kvm_dev = { &kvm_chardev_ops, }; -static int kvm_reboot(struct notifier_block *notifier, unsigned long val, - void *v) -{ - if (val == SYS_RESTART) { - /* - * Some (well, at least mine) BIOSes hang on reboot if - * in vmx root mode. - */ - printk(KERN_INFO "kvm: exiting hardware virtualization\n"); - on_each_cpu(hardware_disable, NULL, 0, 1); - } - return NOTIFY_OK; -} - -static struct notifier_block kvm_reboot_notifier = { - .notifier_call = kvm_reboot, - .priority = 0, -}; - /* * Make sure that a cpu that is being hot-unplugged does not have any vcpus * cached on it. @@ -3027,6 +3006,25 @@ static int kvm_cpu_hotplug(struct notifi return NOTIFY_OK; } +static int kvm_reboot(struct notifier_block *notifier, unsigned long val, + void *v) +{ + if (val == SYS_RESTART) { + /* + * Some (well, at least mine) BIOSes hang on reboot if + * in vmx root mode. + */ + printk(KERN_INFO "kvm: exiting hardware virtualization\n"); + on_each_cpu(hardware_disable, NULL, 0, 1); + } + return NOTIFY_OK; +} + +static struct notifier_block kvm_reboot_notifier = { + .notifier_call = kvm_reboot, + .priority = 0, +}; + void kvm_io_bus_init(struct kvm_io_bus *bus) { memset(bus, 0, sizeof(*bus)); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/