[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/2] pc: fix migration failure after cpu hot-unpl
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v2 2/2] pc: fix migration failure after cpu hot-unplung |
Date: |
Tue, 12 Jul 2016 13:08:46 +0200 |
As described in commit:
cpu: add migration_id to allow board to provide migration instance_id
set CPUState::migration_id explictly to stable index in pcms->possible_cpus
so that CPU's instance_id on target would match instance_id on source
even if not the last added CPU is removed.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/i386/pc.c | 9 ++++++---
include/hw/i386/pc.h | 5 +++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f56e225..9e72eb3 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1040,13 +1040,16 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int
level)
}
static X86CPU *pc_new_cpu(const char *typename, int64_t apic_id,
- Error **errp)
+ Error **errp, int migration_id)
{
X86CPU *cpu = NULL;
+ CPUState *cs;
Error *local_err = NULL;
cpu = X86_CPU(object_new(typename));
+ cs = CPU(cpu);
+ cs->migration_id = migration_id;
object_property_set_int(OBJECT(cpu), apic_id, "apic-id", &local_err);
object_property_set_bool(OBJECT(cpu), true, "realized", &local_err);
@@ -1092,7 +1095,7 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)
assert(pcms->possible_cpus->cpus[0].cpu); /* BSP is always present */
oc = OBJECT_CLASS(CPU_GET_CLASS(pcms->possible_cpus->cpus[0].cpu));
- cpu = pc_new_cpu(object_class_get_name(oc), apic_id, &local_err);
+ cpu = pc_new_cpu(object_class_get_name(oc), apic_id, &local_err, id);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -1156,7 +1159,7 @@ void pc_cpus_init(PCMachineState *pcms)
pcms->possible_cpus->len++;
if (i < smp_cpus) {
cpu = pc_new_cpu(typename, x86_cpu_apic_id_from_index(i),
- &error_fatal);
+ &error_fatal, i);
pcms->possible_cpus->cpus[i].cpu = CPU(cpu);
object_unref(OBJECT(cpu));
}
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 2123532..fea2961 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -373,6 +373,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
.driver = "vmxnet3",\
.property = "romfile",\
.value = "",\
+ },\
+ { \
+ .driver = TYPE_CPU, \
+ .property = "use-migration-id", \
+ .value = "off", \
},
#define PC_COMPAT_2_5 \
--
1.8.3.1
- Re: [Qemu-devel] [RFC PATCH v2 2/5] cpu: Introduce CPUState::stable_cpu_id, (continued)
- Re: [Qemu-devel] [RFC PATCH v2 2/5] cpu: Introduce CPUState::stable_cpu_id, Bharata B Rao, 2016/07/10
- Re: [Qemu-devel] [RFC PATCH v2 2/5] cpu: Introduce CPUState::stable_cpu_id, Igor Mammedov, 2016/07/11
- [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, Igor Mammedov, 2016/07/11
- [Qemu-devel] [PATCH] VARIANT 2: use machine specific callback to pick CPU's migration instance_id, Igor Mammedov, 2016/07/11
- Re: [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, Paolo Bonzini, 2016/07/11
- Re: [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, David Gibson, 2016/07/12
- Re: [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, Igor Mammedov, 2016/07/12
- Re: [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, Bharata B Rao, 2016/07/12
- Re: [Qemu-devel] [PATCH] VARIANT 1: reuse device compat logic to pick preffered CPU's migration instance_id, Igor Mammedov, 2016/07/12
- [Qemu-devel] [PATCH v2 1/2] cpu: add migration_id to allow board to provide migration instance_id, Igor Mammedov, 2016/07/12
- [Qemu-devel] [PATCH v2 2/2] pc: fix migration failure after cpu hot-unplung,
Igor Mammedov <=
- Re: [Qemu-devel] [RFC PATCH v2 2/5] cpu: Introduce CPUState::stable_cpu_id, Igor Mammedov, 2016/07/11
- Re: [Qemu-devel] [RFC PATCH v2 2/5] cpu: Introduce CPUState::stable_cpu_id, David Gibson, 2016/07/12
[Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, Bharata B Rao, 2016/07/07
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, Greg Kurz, 2016/07/07
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, David Gibson, 2016/07/08
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, Greg Kurz, 2016/07/08
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, David Gibson, 2016/07/08
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, Greg Kurz, 2016/07/08
- Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, David Gibson, 2016/07/10
Re: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores, David Gibson, 2016/07/08