Commit:     47e627bc8c9a70392d2049e6af5bd55fae61fe53
Parent:     1e8ba6fba5050ec11bba90c8622aa2ed95ff711f
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:54:43 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:40 2007 -0800

    [PATCH] hotplug: Allow modules to use the cpu hotplug notifiers even if 
    The following patchset allows a host with running virtual machines to be
    suspended and, on at least a subset of the machines tested, resumed.  Note
    that this is orthogonal to suspending and resuming an individual guest to a
    A side effect of implementing suspend/resume is that cpu hotplug is now
    supported.  This should please the owners of big iron.
    This patch:
    KVM wants the cpu hotplug notifications, both for cpu hotplug itself, but 
    commonly for host suspend/resume.
    In order to avoid extensive #ifdefs, provide stubs when CONFIG_CPU_HOTPLUG 
    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 <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Rusty Russell <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 include/linux/cpu.h |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index bfb5202..769ddc6 100644
--- a/include/linux/cpu.h
+++ b/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);
+extern int register_cpu_notifier(struct notifier_block *nb);
 extern void unregister_cpu_notifier(struct notifier_block *nb);
+#ifndef MODULE
+extern int register_cpu_notifier(struct notifier_block *nb);
+static inline int register_cpu_notifier(struct notifier_block *nb)
+       return 0;
 static inline void unregister_cpu_notifier(struct notifier_block *nb)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to