]> Git Repo - qemu.git/commitdiff
qdev: Eliminate qemu_add_globals() function
authorEduardo Habkost <[email protected]>
Wed, 15 Jun 2016 18:54:52 +0000 (15:54 -0300)
committerEduardo Habkost <[email protected]>
Thu, 7 Jul 2016 18:24:50 +0000 (15:24 -0300)
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 <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
hw/core/qdev-properties-system.c
include/qemu/config-file.h
vl.c

index df38b8a03b00b0ba280e499199f2c33a3190ac71..65d9fa9f53f0ead59153eadc6d97a2a0e27f5bf7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * qdev property parsing and global properties
+ * qdev property parsing
  * (parts specific for qemu-system-*)
  *
  * This file is based on code from hw/qdev-properties.c from
@@ -394,22 +394,3 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
     }
     nd->instantiated = 1;
 }
-
-static int qdev_add_one_global(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;
-}
-
-void qemu_add_globals(void)
-{
-    qemu_opts_foreach(qemu_find_opts("global"),
-                      qdev_add_one_global, NULL, NULL);
-}
index 3b8ecb095308a14baed58f7a2f411831fa678b5c..8603e863959ebcb2d080fd728bbdb838e0c44807 100644 (file)
@@ -12,7 +12,6 @@ void qemu_add_opts(QemuOptsList *list);
 void qemu_add_drive_opts(QemuOptsList *list);
 int qemu_set_option(const char *str);
 int qemu_global_option(const char *str);
-void qemu_add_globals(void);
 
 void qemu_config_write(FILE *fp);
 int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname);
diff --git a/vl.c b/vl.c
index 5cd0f2a7db93cd561cd6d4e04d9d86b08cb1ea29..ebdeaa0b9d481454a45c251b8c46a25462c9eccc 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -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
This page took 0.034105 seconds and 4 git commands to generate.