[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH for-3.2 v3 05/14] qdev: move qdev_prop_register_global
From: |
Marc-André Lureau |
Subject: |
[Qemu-ppc] [PATCH for-3.2 v3 05/14] qdev: move qdev_prop_register_global_list() to tests |
Date: |
Wed, 7 Nov 2018 16:36:43 +0400 |
The function is only used by a test, move it there.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
---
include/hw/qdev-properties.h | 1 -
hw/core/qdev-properties.c | 9 ---------
tests/test-qdev-global-props.c | 18 ++++++++++++++----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index a95f4a73eb..3ab9cd2eb6 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -249,7 +249,6 @@ void qdev_prop_set_enum(DeviceState *dev, const char *name,
int value);
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/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index ab61d502fd..bd84c4ea4c 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1180,15 +1180,6 @@ void qdev_prop_register_global(GlobalProperty *prop)
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/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index ccdf6c57c1..b1eb505442 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/test-qdev-global-props.c
@@ -89,6 +89,16 @@ static void test_static_prop(void)
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 @@ static void test_static_globalprop_subprocess(void)
{}
};
- 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 @@ static void test_dynamic_globalprop_subprocess(void)
};
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 @@ static void test_dynamic_globalprop_nouser_subprocess(void)
};
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 @@ static void test_subclass_global_props(void)
{}
};
- qdev_prop_register_global_list(props);
+ register_global_properties(props);
mt = STATIC_TYPE(object_new(TYPE_SUBCLASS));
qdev_init_nofail(DEVICE(mt));
--
2.19.1.708.g4ede3d42df
- [Qemu-ppc] [PATCH for-3.2 v3 00/14] Generalize machine compatibility properties, Marc-André Lureau, 2018/11/07
- [Qemu-ppc] [PATCH for-3.2 v3 05/14] qdev: move qdev_prop_register_global_list() to tests,
Marc-André Lureau <=
- [Qemu-ppc] [PATCH for-3.2 v3 04/14] accel: register global_props like machine globals, Marc-André Lureau, 2018/11/07
- [Qemu-ppc] [PATCH for-3.2 v3 03/14] qom: make user_creatable_complete() specific to UserCreatable, Marc-André Lureau, 2018/11/07
- [Qemu-ppc] [PATCH for-3.2 v3 06/14] qdev: do not mix compat props with global props, Marc-André Lureau, 2018/11/07
- [Qemu-ppc] [PATCH for-3.2 v3 07/14] qdev: all globals are now user-provided, Marc-André Lureau, 2018/11/07
- [Qemu-ppc] [PATCH for-3.2 v3 08/14] qdev-props: convert global_props to GArray, Marc-André Lureau, 2018/11/07