[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 3/7] machine: disallow -smp expose=on for non-ARM machines
From: |
Yanan Wang |
Subject: |
[RFC PATCH v4 3/7] machine: disallow -smp expose=on for non-ARM machines |
Date: |
Tue, 22 Jun 2021 17:34:09 +0800 |
Currently, support for exposure of cpu topology to the guest
is only introduced for ARM machines and we also have an ARM
specific parsing function virt_smp_parse(), so we disallow
the "-smp expose=on" configuration for the other platforms.
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
hw/core/machine.c | 7 +++++++
hw/i386/pc.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 55b9bc7817..23721bb77e 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -746,6 +746,13 @@ static void smp_parse(MachineState *ms, QemuOpts *opts)
unsigned sockets = qemu_opt_get_number(opts, "sockets", 0);
unsigned cores = qemu_opt_get_number(opts, "cores", 0);
unsigned threads = qemu_opt_get_number(opts, "threads", 0);
+ bool expose = qemu_opt_get_bool(opts, "expose", false);
+
+ if (expose) {
+ error_report("expose=on: exposing cpu topology to the guest"
+ "is not supported yet");
+ exit(1);
+ }
/* compute missing values, prefer sockets over cores over threads */
if (cpus == 0 || sockets == 0) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c6d8d0d84d..afabfa0566 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -720,6 +720,13 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
unsigned dies = qemu_opt_get_number(opts, "dies", 1);
unsigned cores = qemu_opt_get_number(opts, "cores", 0);
unsigned threads = qemu_opt_get_number(opts, "threads", 0);
+ bool expose = qemu_opt_get_bool(opts, "expose", false);
+
+ if (expose) {
+ error_report("expose=on: exposing cpu topology to the guest"
+ "is not supported yet");
+ exit(1);
+ }
/* compute missing values, prefer sockets over cores over threads */
if (cpus == 0 || sockets == 0) {
--
2.23.0
- [RFC PATCH v4 0/7] hw/arm/virt: Introduce cpu topology support, Yanan Wang, 2021/06/22
- [RFC PATCH v4 7/7] hw/acpi/aml-build: Generate PPTT table, Yanan Wang, 2021/06/22
- [RFC PATCH v4 2/7] hw/arm/virt: Add separate -smp parsing function for ARM machines, Yanan Wang, 2021/06/22
- [RFC PATCH v4 3/7] machine: disallow -smp expose=on for non-ARM machines,
Yanan Wang <=
- [RFC PATCH v4 4/7] device_tree: Add qemu_fdt_add_path, Yanan Wang, 2021/06/22
- [RFC PATCH v4 6/7] hw/acpi/aml-build: Add Processor hierarchy node structure, Yanan Wang, 2021/06/22
- [RFC PATCH v4 5/7] hw/arm/virt: Add cpu-map to device tree, Yanan Wang, 2021/06/22
- [RFC PATCH v4 1/7] vl: Add expose=on|off option support in -smp command line, Yanan Wang, 2021/06/22
- Re: [RFC PATCH v4 0/7] hw/arm/virt: Introduce cpu topology support, Daniel P . Berrangé, 2021/06/22