diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-03-15 17:01:24 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-04-23 16:08:45 +0200 |
commit | 25920d6ad61b078a69b6ba401d4d6cd46ce83804 (patch) | |
tree | b4066fc7c1369efe2c7312c16550d8bb5b82f0da /hw | |
parent | b9f66d96950b7c10253f9f27b9109df5ff8aa611 (diff) | |
download | hqemu-25920d6ad61b078a69b6ba401d4d6cd46ce83804.zip hqemu-25920d6ad61b078a69b6ba401d4d6cd46ce83804.tar.gz |
Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functions
available in the tools. This involves moving two functions that can only be
built in the context of the emulator.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/qdev-properties.c | 19 | ||||
-rw-r--r-- | hw/qdev.h | 1 |
2 files changed, 18 insertions, 2 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 157a111..9ffdba7 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -661,7 +661,7 @@ void qdev_prop_set_defaults(DeviceState *dev, Property *props) static QTAILQ_HEAD(, GlobalProperty) global_props = QTAILQ_HEAD_INITIALIZER(global_props); -void qdev_prop_register_global(GlobalProperty *prop) +static void qdev_prop_register_global(GlobalProperty *prop) { QTAILQ_INSERT_TAIL(&global_props, prop, next); } @@ -689,3 +689,20 @@ void qdev_prop_set_globals(DeviceState *dev) } } } + +static int qdev_add_one_global(QemuOpts *opts, void *opaque) +{ + GlobalProperty *g; + + g = qemu_mallocz(sizeof(*g)); + g->driver = qemu_opt_get(opts, "driver"); + g->property = qemu_opt_get(opts, "property"); + g->value = qemu_opt_get(opts, "value"); + qdev_prop_register_global(g); + return 0; +} + +void qemu_add_globals(void) +{ + qemu_opts_foreach(&qemu_global_opts, qdev_add_one_global, NULL, 0); +} @@ -273,7 +273,6 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name, uint8_t *value); void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value); void qdev_prop_set_defaults(DeviceState *dev, Property *props); -void qdev_prop_register_global(GlobalProperty *prop); void qdev_prop_register_global_list(GlobalProperty *props); void qdev_prop_set_globals(DeviceState *dev); |