[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v19 14/14] hw/qdev: Remove opts member
From: |
Akihiko Odaki |
Subject: |
[PATCH v19 14/14] hw/qdev: Remove opts member |
Date: |
Thu, 09 Jan 2025 15:29:59 +0900 |
It is no longer used.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
include/hw/qdev-core.h | 4 ----
hw/core/qdev.c | 1 -
system/qdev-monitor.c | 12 +++++++-----
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index e6ef80b7fd0e..c4d3dc39064c 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -248,10 +248,6 @@ struct DeviceState {
* @pending_deleted_expires_ms: optional timeout for deletion events
*/
int64_t pending_deleted_expires_ms;
- /**
- * @opts: QDict of options for the device
- */
- QDict *opts;
/**
* @hotplugged: was device added after PHASE_MACHINE_READY?
*/
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 57c1d9df3a7f..09c4489e3c41 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -691,7 +691,6 @@ static void device_finalize(Object *obj)
dev->canonical_path = NULL;
}
- qobject_unref(dev->opts);
g_free(dev->id);
}
diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
index c844f5380255..6a38b5678760 100644
--- a/system/qdev-monitor.c
+++ b/system/qdev-monitor.c
@@ -631,6 +631,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
char *id;
DeviceState *dev = NULL;
BusState *bus = NULL;
+ QDict *properties;
driver = qdict_get_try_str(opts, "driver");
if (!driver) {
@@ -712,13 +713,14 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
}
/* set properties */
- dev->opts = qdict_clone_shallow(opts);
- qdict_del(dev->opts, "driver");
- qdict_del(dev->opts, "bus");
- qdict_del(dev->opts, "id");
+ properties = qdict_clone_shallow(opts);
+ qdict_del(properties, "driver");
+ qdict_del(properties, "bus");
+ qdict_del(properties, "id");
- object_set_properties_from_keyval(&dev->parent_obj, dev->opts, from_json,
+ object_set_properties_from_keyval(&dev->parent_obj, properties, from_json,
errp);
+ qobject_unref(properties);
if (*errp) {
goto err_del_dev;
}
--
2.47.1
- [PATCH v19 05/14] s390x/pci: Allow plugging SR-IOV devices, (continued)
- [PATCH v19 05/14] s390x/pci: Allow plugging SR-IOV devices, Akihiko Odaki, 2025/01/09
- [PATCH v19 07/14] pcie_sriov: Do not manually unrealize, Akihiko Odaki, 2025/01/09
- [PATCH v19 06/14] s390x/pci: Check for multifunction after device realization, Akihiko Odaki, 2025/01/09
- [PATCH v19 09/14] pcie_sriov: Reuse SR-IOV VF device instances, Akihiko Odaki, 2025/01/09
- [PATCH v19 08/14] pcie_sriov: Ensure VF addr does not overflow, Akihiko Odaki, 2025/01/09
- [PATCH v19 10/14] pcie_sriov: Release VFs failed to realize, Akihiko Odaki, 2025/01/09
- [PATCH v19 11/14] pcie_sriov: Remove num_vfs from PCIESriovPF, Akihiko Odaki, 2025/01/09
- [PATCH v19 13/14] hw/pci: Use -1 as the default value for rombar, Akihiko Odaki, 2025/01/09
- [PATCH v19 12/14] pcie_sriov: Register VFs after migration, Akihiko Odaki, 2025/01/09
- [PATCH v19 14/14] hw/qdev: Remove opts member,
Akihiko Odaki <=
- Re: [PATCH v19 00/14] hw/pci: SR-IOV related fixes and improvements, Philippe Mathieu-Daudé, 2025/01/09