[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/12] introduce CPU hot-plug notifier
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 08/12] introduce CPU hot-plug notifier |
Date: |
Thu, 21 Mar 2013 15:28:41 +0100 |
hot-added CPU id (APIC ID) will be distributed to acpi_piix4 and rtc_cmos
Signed-off-by: Igor Mammedov <address@hidden>
---
include/sysemu/sysemu.h | 4 ++++
stubs/Makefile.objs | 1 +
stubs/qemu_system_cpu_hotplug_request.c | 5 +++++
vl.c | 14 ++++++++++++++
4 files changed, 24 insertions(+), 0 deletions(-)
create mode 100644 stubs/qemu_system_cpu_hotplug_request.c
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 6578782..4b8f721 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -152,6 +152,10 @@ void do_pci_device_hot_remove(Monitor *mon, const QDict
*qdict);
/* generic hotplug */
void drive_hot_add(Monitor *mon, const QDict *qdict);
+/* CPU hotplug */
+void qemu_register_cpu_add_notifier(Notifier *notifier);
+void qemu_system_cpu_hotplug_request(uint32_t id);
+
/* pcie aer error injection */
void pcie_aer_inject_error_print(Monitor *mon, const QObject *data);
int do_pcie_aer_inject_error(Monitor *mon,
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 9741e16..6a492f5 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -25,3 +25,4 @@ stub-obj-y += vmstate.o
stub-obj-$(CONFIG_WIN32) += fd-register.o
stub-obj-y += resume_vcpu.o
stub-obj-y += get_icc_bus.o
+stub-obj-y += qemu_system_cpu_hotplug_request.o
diff --git a/stubs/qemu_system_cpu_hotplug_request.c
b/stubs/qemu_system_cpu_hotplug_request.c
new file mode 100644
index 0000000..ad4f394
--- /dev/null
+++ b/stubs/qemu_system_cpu_hotplug_request.c
@@ -0,0 +1,5 @@
+#include <sysemu/sysemu.h>
+
+void qemu_system_cpu_hotplug_request(uint32_t id)
+{
+}
diff --git a/vl.c b/vl.c
index aeed7f4..fd95e43 100644
--- a/vl.c
+++ b/vl.c
@@ -1723,6 +1723,20 @@ void vm_start(void)
}
}
+/* CPU hot-plug notifiers */
+static NotifierList cpu_add_notifiers =
+ NOTIFIER_LIST_INITIALIZER(cpu_add_notifiers);
+
+void qemu_register_cpu_add_notifier(Notifier *notifier)
+{
+ notifier_list_add(&cpu_add_notifiers, notifier);
+}
+
+void qemu_system_cpu_hotplug_request(uint32_t id)
+{
+ notifier_list_notify(&cpu_add_notifiers, &id);
+}
+
/* reset/shutdown handler */
typedef struct QEMUResetEntry {
--
1.7.1
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, (continued)
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Andreas Färber, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Andreas Färber, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Paolo Bonzini, 2013/03/27
[Qemu-devel] [PATCH 07/12] target-i386: Add ICC_BUS and attach apic, kvmvapic and cpu to it, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 09/12] rtc: update rtc_cmos on CPU hot-plug, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 06/12] target-i386: replace FROM_SYSBUS() with QOM type cast, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 08/12] introduce CPU hot-plug notifier,
Igor Mammedov <=
[Qemu-devel] [PATCH 10/12] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Igor Mammedov, 2013/03/21
[Qemu-devel] [PATCH 11/12] qmp: add cpu_set qmp command, Igor Mammedov, 2013/03/21