diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-14 07:51:30 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-14 07:51:30 -0500 |
commit | 5f13731f8cb6aadecf214513ec810d61dc1f71dc (patch) | |
tree | befdd804224f893f36f8c8c839ddb96e8f06e4c5 /hw/i386/pc.c | |
parent | 86a6a0774509c59f1570f763a0fad57e26762d9c (diff) | |
parent | c67e216bdf42abfb8505790b2da9562356103976 (diff) |
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
# By Andreas Färber (12) and others
# Via Andreas Färber
* afaerber/qom-cpu:
spapr_rtas: Abstract rtas_start_cpu() with qemu_get_cpu()
spapr_rtas: Abstract rtas_query_cpu_stopped_state() with qemu_get_cpu()
memory_mapping: Improve qemu_get_guest_memory_mapping() error reporting
dump: Abstract dump_init() with cpu_synchronize_all_states()
cpu: Change default for CPUClass::get_paging_enabled()
dump: Drop qmp_dump_guest_memory() stub and build for all targets
memory_mapping: Drop qemu_get_memory_mapping() stub
cpu: Turn cpu_get_memory_mapping() into a CPUState hook
memory_mapping: Move MemoryMappingList typedef to qemu/typedefs.h
cpu: Turn cpu_paging_enabled() into a CPUState hook
monitor: Simplify do_inject_mce() with qemu_get_cpu()
target-i386: cpu: Fix potential buffer overrun in get_register_name_32()
target-i386: Set level=4 on Conroe/Penryn/Nehalem
target-i386: Update model values on Conroe/Penryn/Nehalem CPU models
pc: Create pc-*-1.6 machine-types
pc: Fix crash when attempting to hotplug CPU with negative ID
dump: Move stubs into libqemustub.a
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r-- | hw/i386/pc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4844a6b370..553becbd42 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -927,6 +927,11 @@ void pc_hot_add_cpu(const int64_t id, Error **errp) DeviceState *icc_bridge; int64_t apic_id = x86_cpu_apic_id_from_index(id); + if (id < 0) { + error_setg(errp, "Invalid CPU id: %" PRIi64, id); + return; + } + if (cpu_exists(apic_id)) { error_setg(errp, "Unable to add CPU: %" PRIi64 ", it already exists", id); |