qdev: move qdev_prop_register_global_list() to tests
The function is only used by a test, move it there.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181204142023.15982-6-marcandre.lureau@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index ab61d50..bd84c4e 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1180,15 +1180,6 @@
global_props = g_list_append(global_props, prop);
}
-void qdev_prop_register_global_list(GlobalProperty *props)
-{
- int i;
-
- for (i = 0; props[i].driver != NULL; i++) {
- qdev_prop_register_global(props+i);
- }
-}
-
int qdev_prop_check_globals(void)
{
GList *l;
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index a95f4a7..3ab9cd2 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -249,7 +249,6 @@
void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value);
void qdev_prop_register_global(GlobalProperty *prop);
-void qdev_prop_register_global_list(GlobalProperty *props);
int qdev_prop_check_globals(void);
void qdev_prop_set_globals(DeviceState *dev);
void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index ccdf6c5..b1eb505 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/test-qdev-global-props.c
@@ -89,6 +89,16 @@
g_test_trap_assert_stdout("");
}
+static void register_global_properties(GlobalProperty *props)
+{
+ int i;
+
+ for (i = 0; props[i].driver != NULL; i++) {
+ qdev_prop_register_global(props + i);
+ }
+}
+
+
/* Test setting of static property using global properties */
static void test_static_globalprop_subprocess(void)
{
@@ -98,7 +108,7 @@
{}
};
- qdev_prop_register_global_list(props);
+ register_global_properties(props);
mt = STATIC_TYPE(object_new(TYPE_STATIC_PROPS));
qdev_init_nofail(DEVICE(mt));
@@ -216,7 +226,7 @@
};
int global_error;
- qdev_prop_register_global_list(props);
+ register_global_properties(props);
mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));
qdev_init_nofail(DEVICE(mt));
@@ -261,7 +271,7 @@
};
int global_error;
- qdev_prop_register_global_list(props);
+ register_global_properties(props);
mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));
qdev_init_nofail(DEVICE(mt));
@@ -299,7 +309,7 @@
{}
};
- qdev_prop_register_global_list(props);
+ register_global_properties(props);
mt = STATIC_TYPE(object_new(TYPE_SUBCLASS));
qdev_init_nofail(DEVICE(mt));