diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2015-10-13 13:37:42 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2015-11-18 21:13:48 +0100 |
commit | 2465bc564d39d9b62fa21b3e84313be3b32dbc16 (patch) | |
tree | cbc6f53a0341b8cedcfa835120518561fa98e18f /vl.c | |
parent | 1b30c094dcb69273b7661897c067906f81e5b967 (diff) |
vl: Convert machine help code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1536,12 +1536,14 @@ MachineInfoList *qmp_query_machines(Error **errp) static int machine_help_func(QemuOpts *opts, MachineState *machine) { ObjectProperty *prop; + ObjectPropertyIterator *iter; if (!qemu_opt_has_help_opt(opts)) { return 0; } - QTAILQ_FOREACH(prop, &OBJECT(machine)->properties, node) { + iter = object_property_iter_init(OBJECT(machine)); + while ((prop = object_property_iter_next(iter))) { if (!prop->set) { continue; } @@ -1554,6 +1556,7 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine) error_printf("\n"); } } + object_property_iter_free(iter); return 1; } |