[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 5/7] i386: implement pc interface cpu_common_unr
From: |
Gu Zheng |
Subject: |
[Qemu-devel] [RFC PATCH 5/7] i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c |
Date: |
Fri, 11 Jul 2014 17:59:53 +0800 |
From: Chen Fan <address@hidden>
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>
Signed-off-by: Gu Zheng <address@hidden>
---
qom/cpu.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/qom/cpu.c b/qom/cpu.c
index f921282..8bb2b4f 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -315,6 +315,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);
@@ -348,6 +359,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
k->gdb_write_register = cpu_common_gdb_write_register;
k->virtio_is_big_endian = cpu_common_virtio_is_big_endian;
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.7.7
- [Qemu-devel] [RFC PATCH 0/7] i386: add cpu hot remove support, Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 6/7] cpu hotplug: implement function cpu_status_write() for vcpu ejection, Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 1/7] x86: add x86_cpu_unrealizefn() for cpu apic remove, Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 5/7] i386: implement pc interface cpu_common_unrealizefn() in qom/cpu.c,
Gu Zheng <=
- [Qemu-devel] [RFC PATCH 2/7] i386: add cpu device_del support, Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 3/7] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier', Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 4/7] qom cpu: add UNPLUG cpu notify support, Gu Zheng, 2014/07/11
- [Qemu-devel] [RFC PATCH 7/7] cpus: reclaim allocated vCPU objects, Gu Zheng, 2014/07/11
- Re: [Qemu-devel] [RFC PATCH 0/7] i386: add cpu hot remove support, Gu Zheng, 2014/07/14
- Re: [Qemu-devel] [RFC PATCH 0/7] i386: add cpu hot remove support, Gu Zheng, 2014/07/21