[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC qom-next v5 6/8] i386: implement pc interface cpu_comm
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC qom-next v5 6/8] i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c |
Date: |
Mon, 23 Dec 2013 17:04:07 +0800 |
add interface cpu_common_unrealizefn() for emiting vcpu unplug
notifier to ACPI, then ACPI could send sci interrupt
to OS for hot-remove vcpu.
Signed-off-by: Chen Fan <address@hidden>
---
qom/cpu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/qom/cpu.c b/qom/cpu.c
index 728b83b..78038ab 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -228,6 +228,17 @@ static void cpu_common_realizefn(DeviceState *dev, Error
**errp)
}
}
+static void cpu_common_unrealizefn(DeviceState *dev, Error **errp)
+{
+ CPUNotifier notifier;
+
+ notifier.dev = dev;
+ notifier.type = UNPLUG;
+
+ notifier_list_notify(&cpu_hotplug_notifiers, ¬ifier);
+}
+
+
static void cpu_common_initfn(Object *obj)
{
CPUState *cpu = CPU(obj);
@@ -258,6 +269,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
k->gdb_read_register = cpu_common_gdb_read_register;
k->gdb_write_register = cpu_common_gdb_write_register;
dc->realize = cpu_common_realizefn;
+ dc->unrealize = cpu_common_unrealizefn;
/*
* Reason: CPUs still need special care by board code: wiring up
* IRQs, adding reset handlers, halting non-first CPUs, ...
--
1.8.1.4
- [Qemu-devel] [RFC qom-next v5 0/8] i386: add cpu hot remove support, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 1/8] x86: move apic_state field from CPUX86State to X86CPU, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 2/8] x86: add x86_cpu_unrealizefn() for cpu apic remove, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 8/8] cpus: reclaim allocated vCPU objects, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 3/8] qmp: add 'cpu-del' command support, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 4/8] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier', Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 7/8] piix4: implement function cpu_status_write() for vcpu ejection, Chen Fan, 2013/12/23
- [Qemu-devel] [RFC qom-next v5 6/8] i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c,
Chen Fan <=
- [Qemu-devel] [RFC qom-next v5 5/8] qom cpu: add UNPLUG cpu notifier support, Chen Fan, 2013/12/23