[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API |
Date: |
Fri, 3 Feb 2023 19:09:00 +0100 |
No need to use the low-level QOM API when an object
inherits from QDev. Directly use the QDev API to set
its properties.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/core/numa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index d8d36b16d8..9b6f9848e3 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -34,6 +34,7 @@
#include "qapi/opts-visitor.h"
#include "qapi/qapi-visit-machine.h"
#include "sysemu/qtest.h"
+#include "hw/qdev-properties.h"
#include "hw/core/cpu.h"
#include "hw/mem/pc-dimm.h"
#include "migration/vmstate.h"
@@ -740,8 +741,7 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState
*dev, Error **errp)
/* due to bug in libvirt, it doesn't pass node-id from props on
* device_add as expected, so we have to fix it up here */
if (slot->props.has_node_id) {
- object_property_set_int(OBJECT(dev), "node-id",
- slot->props.node_id, errp);
+ qdev_prop_set_int32(dev, "node-id", slot->props.node_id);
}
} else if (node_id != slot->props.node_id) {
error_setg(errp, "invalid node-id, must be %"PRId64,
--
2.38.1
- [PATCH 00/19] hw: Set QDev properties using QDev API (part 1/3), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 01/19] NOTFORMERGE scripts/coccinelle: Add qom-qdev-prop.cocci, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 02/19] hw/qdev: Introduce qdev_prop_set_link(), Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 03/19] hw/acpi: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 04/19] hw/audio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API,
Philippe Mathieu-Daudé <=
- [PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 07/19] hw/scsi: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 08/19] hw/usb: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 10/19] hw/avr: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 09/19] hw/virtio: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 11/19] hw/hppa: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03
- [PATCH 13/19] hw/m68k: Set QDev properties using QDev API, Philippe Mathieu-Daudé, 2023/02/03