@@ -49,6 +49,17 @@ static void object_set_globals(Object *obj,
} while (class);
}
+const char *qemu_global_get(const char *driver, const char *property)
+{
+ GlobalProperty *prop;
+ QTAILQ_FOREACH(prop, &global_props, next) {
+ if (!strcmp(prop->driver, driver) && !strcmp(prop->property, property)) {
+ return prop->value;
+ }
+ }
+ return NULL;
+}
+
void qdev_prop_set_globals(DeviceState *dev)
{
return object_set_globals(OBJECT(dev), qdev_global_parse);
@@ -337,6 +337,14 @@ void qemu_globals_register_list(GlobalProperty *props);
void qdev_prop_set_globals(DeviceState *dev);
void object_prop_set_globals(Object *obj);
+/* Get the string value of a global property directly
+ *
+ * Using this function is discouraged. Code should be converted to use
+ * QOM and/or qdev instead of using it. It is provided only as a convenience
+ * for code that is not converted yet.
+ */
+const char *qemu_global_get(const char *driver, const char *property);
+
char *qdev_get_fw_dev_path(DeviceState *dev);
/**
Useful for cases where code is not converted to QOM and/or QDEV yet, but needs to check the value of a global property. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- global-properties.c | 11 +++++++++++ hw/qdev.h | 8 ++++++++ 2 files changed, 19 insertions(+)