public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: kvm-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, mingo@elte.hu
Subject: [PATCH 1/5] hotplug: Allow modules to use the cpu hotplug notifiers even if !CONFIG_HOTPLUG_CPU
Date: Tue, 30 Jan 2007 14:53:16 -0000	[thread overview]
Message-ID: <20070130145316.DC710A0014@il.qumranet.com> (raw)
In-Reply-To: <45BF5B96.1070007@qumranet.com>

KVM wants the cpu hotplug notifications, both for cpu hotplug itself, but more
commonly for host suspend/resume.

In order to avoid extensive #ifdefs, provide stubs when CONFIG_CPU_HOTPLUG is
not defined.

In all, we have four cases:

- UP: register and unregister stubbed out
- SMP+hotplug: full register and unregister
- SMP, no hotplug, core: register as __init, unregister stubbed
      (cpus are brought up during core initialization)
- SMP, no hotplug, module: register and unregister stubbed out
      (cpus cannot be brought up during module lifetime)

Signed-off-by: Avi Kivity <avi@qumranet.com>

Index: linux-2.6/include/linux/cpu.h
===================================================================
--- linux-2.6.orig/include/linux/cpu.h
+++ linux-2.6/include/linux/cpu.h
@@ -49,10 +49,20 @@ struct notifier_block;
 
 #ifdef CONFIG_SMP
 /* Need to know about CPUs going up/down? */
-extern int register_cpu_notifier(struct notifier_block *nb);
 #ifdef CONFIG_HOTPLUG_CPU
+extern int register_cpu_notifier(struct notifier_block *nb);
 extern void unregister_cpu_notifier(struct notifier_block *nb);
 #else
+
+#ifndef MODULE
+extern int register_cpu_notifier(struct notifier_block *nb);
+#else
+static inline int register_cpu_notifier(struct notifier_block *nb)
+{
+	return 0;
+}
+#endif
+
 static inline void unregister_cpu_notifier(struct notifier_block *nb)
 {
 }

  reply	other threads:[~2007-01-30 14:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 14:52 [PATCH 0/5] KVM: suspend/resume support Avi Kivity
2007-01-30 14:53 ` Avi Kivity [this message]
2007-01-30 14:54 ` [PATCH 2/5] KVM: Add a global list of all virtual machines Avi Kivity
2007-01-30 14:55 ` [PATCH 3/5] KVM: VMX: add vcpu_clear() Avi Kivity
2007-01-30 14:56 ` [PATCH 4/5] KVM: cpu hotplug support Avi Kivity
     [not found]   ` <20070130145616.EFD52A0014-LjA0eNSCdXrQnzwC+xcbyw@public.gmane.org>
2007-01-31  0:48     ` Andrew Morton
     [not found]       ` <20070130164829.ce7f2f90.akpm-3NddpPZAyC0@public.gmane.org>
2007-01-31  8:50         ` Ingo Molnar
2007-01-31 11:04           ` Avi Kivity
     [not found] ` <45BF5B96.1070007-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-30 14:57   ` [PATCH 5/5] KVM: Host suspend/resume support Avi Kivity
2007-01-30 21:20     ` Nigel Cunningham
     [not found]       ` <1170192049.4308.16.camel-MhVfhJ0qHmuWn91e4EydUaxOck334EZe@public.gmane.org>
2007-01-30 22:19         ` Rafael J. Wysocki
     [not found]           ` <200701302319.10369.rjw-KKrjLPT3xs0@public.gmane.org>
2007-01-31  0:42             ` Nigel Cunningham
2007-01-31  9:07             ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070130145316.DC710A0014@il.qumranet.com \
    --to=avi@qumranet.com \
    --cc=akpm@osdl.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox