aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-12 17:33:14 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-27 09:37:30 +0100
commit7156e82f4a4e1928aad5b6df71319ba3f67af0c3 (patch)
treec799e88e645a2303f988f3b0402b77da86568ebb
parent9b0c44334cf7032dc5529c5ecbe1929f76668c11 (diff)
downloadqemu-7156e82f4a4e1928aad5b6df71319ba3f67af0c3.zip
qemu-7156e82f4a4e1928aad5b6df71319ba3f67af0c3.tar.gz
qemu-7156e82f4a4e1928aad5b6df71319ba3f67af0c3.tar.bz2
hw/i386/sgx: Use QDev API
Prefer the QDev API over the low level QOM one. No logical change intended. Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20240215142035.73331-4-philmd@linaro.org>
-rw-r--r--hw/i386/sgx.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index 7030554..de76397 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -286,7 +286,6 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
SGXEPCState *sgx_epc = &pcms->sgx_epc;
X86MachineState *x86ms = X86_MACHINE(pcms);
SgxEPCList *list = NULL;
- Object *obj;
memset(sgx_epc, 0, sizeof(SGXEPCState));
if (!x86ms->sgx_epc_list) {
@@ -300,16 +299,15 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
&sgx_epc->mr);
for (list = x86ms->sgx_epc_list; list; list = list->next) {
- obj = object_new("sgx-epc");
+ DeviceState *dev = qdev_new(TYPE_SGX_EPC);
/* set the memdev link with memory backend */
- object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memdev,
- &error_fatal);
+ object_property_parse(OBJECT(dev), SGX_EPC_MEMDEV_PROP,
+ list->value->memdev, &error_fatal);
/* set the numa node property for sgx epc object */
- object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value->node,
- &error_fatal);
- object_property_set_bool(obj, "realized", true, &error_fatal);
- object_unref(obj);
+ object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP,
+ list->value->node, &error_fatal);
+ qdev_realize_and_unref(dev, NULL, &error_fatal);
}
if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) {