WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux-2.6.18: add missing kobject_uevent() invocatio

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux-2.6.18: add missing kobject_uevent() invocations for CPU hotplug code
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 11 Jan 2011 14:03:05 +0000
Delivery-date: Tue, 11 Jan 2011 06:04:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Their counterparts in drivers/base/cpu.c:store_online() got added
around 2.6.12.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/drivers/xen/core/cpu_hotplug.c
+++ b/drivers/xen/core/cpu_hotplug.c
@@ -1,6 +1,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/kobject.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <xen/cpu_hotplug.h>
@@ -24,7 +25,7 @@ static int local_cpu_hotplug_request(voi
        return (current->mm != NULL);
 }
 
-static void vcpu_hotplug(unsigned int cpu)
+static void vcpu_hotplug(unsigned int cpu, struct sys_device *dev)
 {
        int err;
        char dir[32], state[32];
@@ -41,10 +42,12 @@ static void __cpuinit vcpu_hotplug(unsig
 
        if (strcmp(state, "online") == 0) {
                cpu_set(cpu, xenbus_allowed_cpumask);
-               (void)cpu_up(cpu);
+               if (!cpu_up(cpu) && dev)
+                       kobject_uevent(&dev->kobj, KOBJ_ONLINE);
        } else if (strcmp(state, "offline") == 0) {
                cpu_clear(cpu, xenbus_allowed_cpumask);
-               (void)cpu_down(cpu);
+               if (!cpu_down(cpu) && dev)
+                       kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
        } else {
                printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n",
                       state, cpu);
@@ -60,7 +63,7 @@ static void __cpuinit handle_vcpu_hotplu
 
        if ((cpustr = strstr(node, "cpu/")) != NULL) {
                sscanf(cpustr, "cpu/%u", &cpu);
-               vcpu_hotplug(cpu);
+               vcpu_hotplug(cpu, get_cpu_sysdev(cpu));
        }
 }
 
@@ -93,7 +96,7 @@ static int __cpuinit setup_cpu_watcher(s
 
        if (!is_initial_xendomain()) {
                for_each_possible_cpu(i)
-                       vcpu_hotplug(i);
+                       vcpu_hotplug(i, get_cpu_sysdev(i));
                printk(KERN_INFO "Brought up %ld CPUs\n",
                       (long)num_online_cpus());
        }
@@ -130,7 +133,7 @@ int __ref smp_suspend(void)
                        printk(KERN_CRIT "Failed to take all CPUs "
                               "down: %d.\n", err);
                        for_each_possible_cpu(cpu)
-                               vcpu_hotplug(cpu);
+                               vcpu_hotplug(cpu, NULL);
                        return err;
                }
        }
@@ -145,7 +148,7 @@ void __ref smp_resume(void)
        for_each_possible_cpu(cpu) {
                if (cpu == 0)
                        continue;
-               vcpu_hotplug(cpu);
+               vcpu_hotplug(cpu, NULL);
        }
 }
 




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux-2.6.18: add missing kobject_uevent() invocations for CPU hotplug code, Jan Beulich <=