Skip to content

Commit ad1ea5f

Browse files
akihikodakiphilmd
authored andcommitted
qdev: Remove opts member
It is no longer used. Signed-off-by: Akihiko Odaki <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent a7a3784 commit ad1ea5f

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

hw/core/qdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ static void device_finalize(Object *obj)
691691
dev->canonical_path = NULL;
692692
}
693693

694-
qobject_unref(dev->opts);
695694
g_free(dev->id);
696695
}
697696

include/hw/qdev-core.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ struct DeviceState {
248248
* @pending_deleted_expires_ms: optional timeout for deletion events
249249
*/
250250
int64_t pending_deleted_expires_ms;
251-
/**
252-
* @opts: QDict of options for the device
253-
*/
254-
QDict *opts;
255251
/**
256252
* @hotplugged: was device added after PHASE_MACHINE_READY?
257253
*/

system/qdev-monitor.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
631631
char *id;
632632
DeviceState *dev = NULL;
633633
BusState *bus = NULL;
634+
QDict *properties;
634635

635636
driver = qdict_get_try_str(opts, "driver");
636637
if (!driver) {
@@ -712,13 +713,14 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
712713
}
713714

714715
/* set properties */
715-
dev->opts = qdict_clone_shallow(opts);
716-
qdict_del(dev->opts, "driver");
717-
qdict_del(dev->opts, "bus");
718-
qdict_del(dev->opts, "id");
716+
properties = qdict_clone_shallow(opts);
717+
qdict_del(properties, "driver");
718+
qdict_del(properties, "bus");
719+
qdict_del(properties, "id");
719720

720-
object_set_properties_from_keyval(&dev->parent_obj, dev->opts, from_json,
721+
object_set_properties_from_keyval(&dev->parent_obj, properties, from_json,
721722
errp);
723+
qobject_unref(properties);
722724
if (*errp) {
723725
goto err_del_dev;
724726
}

0 commit comments

Comments
 (0)