mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
1b30c094dc
commit
2465bc564d
1 changed files with 4 additions and 1 deletions
5
vl.c
5
vl.c
|
@ -1536,12 +1536,14 @@ MachineInfoList *qmp_query_machines(Error **errp)
|
||||||
static int machine_help_func(QemuOpts *opts, MachineState *machine)
|
static int machine_help_func(QemuOpts *opts, MachineState *machine)
|
||||||
{
|
{
|
||||||
ObjectProperty *prop;
|
ObjectProperty *prop;
|
||||||
|
ObjectPropertyIterator *iter;
|
||||||
|
|
||||||
if (!qemu_opt_has_help_opt(opts)) {
|
if (!qemu_opt_has_help_opt(opts)) {
|
||||||
return 0;
|
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) {
|
if (!prop->set) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1554,6 +1556,7 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine)
|
||||||
error_printf("\n");
|
error_printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
object_property_iter_free(iter);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue