[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 10/14] none-machine: allow several cpus
From: |
Damien Hedde |
Subject: |
[PATCH v4 10/14] none-machine: allow several cpus |
Date: |
Wed, 23 Feb 2022 10:07:02 +0100 |
In order to dynamically create (cold-plugging) cpus, we need to
increase _maxcpus_. This value is indeed used to initialize the
accelerator during qemu startup.
Allowing 16 seems a good starting point.
Add a check to prevent a user to request more than 1 cpu if he
specifies the cpu type on the CLI so that the legacy use case
of the none machine is preserved.
This commit is needed to use the 'none' machine as a base, and
subsequently to dynamically populate it wth cpus usign qapi
commands.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
hw/core/null-machine.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 702b56232d..64f9931857 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -34,6 +34,10 @@ static void machine_none_init(MachineState *mch)
/* Initialize CPU (if user asked for it) */
if (mch->cpu_type) {
+ if (mch->smp.cpus > 1) {
+ error_report("Cannot initialize more than 1 CPU");
+ exit(1);
+ }
cpu = cpu_create(mch->cpu_type);
if (!cpu) {
error_report("Unable to initialize CPU");
@@ -79,7 +83,7 @@ static void machine_none_class_init(ObjectClass *oc, void
*data)
mc->desc = "empty machine";
mc->init = machine_none_init;
- mc->max_cpus = 1;
+ mc->max_cpus = 16;
mc->default_ram_size = 0;
mc->default_ram_id = "ram";
mc->no_serial = 1;
--
2.35.1
- [PATCH v4 00/14] Initial support for machine creation via QMP, Damien Hedde, 2022/02/23
- [PATCH v4 05/14] qapi/device_add: handle the rom_order_override when cold-plugging, Damien Hedde, 2022/02/23
- [PATCH v4 10/14] none-machine: allow several cpus,
Damien Hedde <=
- [PATCH v4 08/14] none-machine: add 'ram-addr' property, Damien Hedde, 2022/02/23
- [PATCH v4 02/14] machine&vl: introduce phase_until() to handle phase transitions, Damien Hedde, 2022/02/23
- [PATCH v4 06/14] qapi/device_add: Allow execution in machine initialized phase, Damien Hedde, 2022/02/23
- [PATCH v4 07/14] none-machine: add the NoneMachineState structure, Damien Hedde, 2022/02/23
- [PATCH v4 01/14] machine: add phase_get() and document phase_check()/advance(), Damien Hedde, 2022/02/23
- [PATCH v4 03/14] vl: support machine-initialized target in phase_until(), Damien Hedde, 2022/02/23
- [PATCH v4 12/14] add sysbus-mmio-map qapi command, Damien Hedde, 2022/02/23
- [PATCH v4 04/14] qapi/device_add: compute is_hotplug flag, Damien Hedde, 2022/02/23
- [PATCH v4 09/14] none-machine: allow cold plugging sysbus devices, Damien Hedde, 2022/02/23
- [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/23