QemuOpts: Convert qemu_opt_foreach() to Error
Retain the function value for now, to permit selective conversion of
its callers.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/vl.c b/vl.c
index b12e6ff..d4b2d03 100644
--- a/vl.c
+++ b/vl.c
@@ -2576,8 +2576,9 @@
free(mem);
}
-static int machine_set_property(const char *name, const char *value,
- void *opaque)
+static int machine_set_property(void *opaque,
+ const char *name, const char *value,
+ Error **errp)
{
Object *obj = OBJECT(opaque);
Error *local_err = NULL;
@@ -4070,8 +4071,8 @@
}
machine_opts = qemu_get_machine_opts();
- if (qemu_opt_foreach(machine_opts, machine_set_property,
- current_machine)) {
+ if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
+ NULL)) {
object_unref(OBJECT(current_machine));
exit(1);
}