aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-24 15:28:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-24 15:28:26 +0100
commitf7f1d916b22306c35ab9c090aab5233a91b4b7f9 (patch)
tree223f1864a618983e58e6ef1d7df2750d2ea28498 /hw/core
parentc122bca9cd7b986be4d473240a4fec6315b7a2c2 (diff)
parent418b473e8f586247475e8adc5d048598e5721361 (diff)
downloadqemu-f7f1d916b22306c35ab9c090aab5233a91b4b7f9.zip
qemu-f7f1d916b22306c35ab9c090aab5233a91b4b7f9.tar.gz
qemu-f7f1d916b22306c35ab9c090aab5233a91b4b7f9.tar.bz2
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
machine + QOM queue, 2020-09-22 QOM cleanups: * Convert instance properties to class properties (Eduardo Habkost) * simplify object_find_property / object_class_find_property (Daniel P. Berrangé) Deprecated feature removal: * Drop support for invalid topologies (Igor Mammedov) # gpg: Signature made Tue 22 Sep 2020 23:25:01 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: sifive_u: Register "start-in-flash" as class property sifive_e: Register "revb" as class property i440fx: Register i440FX-pcihost properties as class properties machine: Register "memory-backend" as class property xlnx-zcu102: Register properties as class properties cpu/core: Register core-id and nr-threads as class properties s390x: Register all CPU properties as class properties cryptodev-backend: Register "chardev" as class property cryptodev-vhost-user: Register "chardev" as class property smp: drop support for deprecated (invalid topologies) qom: simplify object_find_property / object_class_find_property Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/machine.c28
-rw-r--r--hw/core/qdev-properties-system.c2
-rw-r--r--hw/core/sysbus.c2
3 files changed, 12 insertions, 20 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index ea26d61..9b02fb2 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -754,23 +754,15 @@ static void smp_parse(MachineState *ms, QemuOpts *opts)
exit(1);
}
- if (sockets * cores * threads > ms->smp.max_cpus) {
- error_report("cpu topology: "
- "sockets (%u) * cores (%u) * threads (%u) > "
- "maxcpus (%u)",
+ if (sockets * cores * threads != ms->smp.max_cpus) {
+ error_report("Invalid CPU topology: "
+ "sockets (%u) * cores (%u) * threads (%u) "
+ "!= maxcpus (%u)",
sockets, cores, threads,
ms->smp.max_cpus);
exit(1);
}
- if (sockets * cores * threads != ms->smp.max_cpus) {
- warn_report("Invalid CPU topology deprecated: "
- "sockets (%u) * cores (%u) * threads (%u) "
- "!= maxcpus (%u)",
- sockets, cores, threads,
- ms->smp.max_cpus);
- }
-
ms->smp.cpus = cpus;
ms->smp.cores = cores;
ms->smp.threads = threads;
@@ -874,6 +866,12 @@ static void machine_class_init(ObjectClass *oc, void *data)
machine_get_memory_encryption, machine_set_memory_encryption);
object_class_property_set_description(oc, "memory-encryption",
"Set memory encryption object to use");
+
+ object_class_property_add_str(oc, "memory-backend",
+ machine_get_memdev, machine_set_memdev);
+ object_class_property_set_description(oc, "memory-backend",
+ "Set RAM backend"
+ "Valid value is ID of hostmem based backend");
}
static void machine_class_base_init(ObjectClass *oc, void *data)
@@ -925,12 +923,6 @@ static void machine_initfn(Object *obj)
"Table (HMAT)");
}
- object_property_add_str(obj, "memory-backend",
- machine_get_memdev, machine_set_memdev);
- object_property_set_description(obj, "memory-backend",
- "Set RAM backend"
- "Valid value is ID of hostmem based backend");
-
/* Register notifier when init is done for sysbus sanity checks */
ms->sysbus_notifier.notify = machine_init_notify;
qemu_add_machine_init_done_notifier(&ms->sysbus_notifier);
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 3e4f16f..b29daf4 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -460,7 +460,7 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
qdev_prop_set_netdev(dev, "netdev", nd->netdev);
}
if (nd->nvectors != DEV_NVECTORS_UNSPECIFIED &&
- object_property_find(OBJECT(dev), "vectors", NULL)) {
+ object_property_find(OBJECT(dev), "vectors")) {
qdev_prop_set_uint32(dev, "vectors", nd->nvectors);
}
nd->instantiated = 1;
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 294f90b..68e8dc8 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -93,7 +93,7 @@ bool sysbus_has_irq(SysBusDevice *dev, int n)
char *prop = g_strdup_printf("%s[%d]", SYSBUS_DEVICE_GPIO_IRQ, n);
ObjectProperty *r;
- r = object_property_find(OBJECT(dev), prop, NULL);
+ r = object_property_find(OBJECT(dev), prop);
g_free(prop);
return (r != NULL);