qdev: Eliminate qemu_add_globals() function
The function is just a helper to handle the -global options, it can stay in vl.c like most qemu_opts_foreach() calls. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
1 parent
823efc5d26
commit
8d76bfe8f8
3 files changed
+16
-22
No files matched your search
@@ -2913,6 +2913,19 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
|
||||
loc_pop(&loc);
|
||||
}
|
||||
|
||||
static int global_init_func(void *opaque, QemuOpts *opts, Error **errp)
|
||||
{
|
||||
GlobalProperty *g;
|
||||
|
||||
g = g_malloc0(sizeof(*g));
|
||||
g->driver = qemu_opt_get(opts, "driver");
|
||||
g->property = qemu_opt_get(opts, "property");
|
||||
g->value = qemu_opt_get(opts, "value");
|
||||
g->user_provided = true;
|
||||
qdev_prop_register_global(g);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
int i;
|
||||
@@ -4442,7 +4455,8 @@ int main(int argc, char **argv, char **envp)
|
||||
qdev_prop_register_global(p);
|
||||
}
|
||||
}
|
||||
qemu_add_globals();
|
||||
qemu_opts_foreach(qemu_find_opts("global"),
|
||||
global_init_func, NULL, NULL);
|
||||
|
||||
/* This checkpoint is required by replay to separate prior clock
|
||||
reading from the other reads, because timer polling functions query
|
||||
|
||||
Reference in new issue
Block a user