From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
dgilbert@redhat.com, "Richard Henderson" <rth@twiddle.net>,
"Andreas Färber" <afaerber@suse.de>,
"Igor Mammedov" <imammedo@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 3/9] qdev: move qdev_prop_register_global_list() to tests
Date: Wed, 12 Sep 2018 16:55:25 +0400 [thread overview]
Message-ID: <20180912125531.32131-4-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20180912125531.32131-1-marcandre.lureau@redhat.com>
The function is only used by a test, move it there.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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 d81b0862d5..d8596e6637 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_list(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_list(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 all_used;
- qdev_prop_register_global_list(props);
+ register_global_list(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 all_used;
- qdev_prop_register_global_list(props);
+ register_global_list(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_list(props);
mt = STATIC_TYPE(object_new(TYPE_SUBCLASS));
qdev_init_nofail(DEVICE(mt));
--
2.19.0.rc1
next prev parent reply other threads:[~2018-09-12 12:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 12:55 [Qemu-devel] [PATCH 0/9] hostmem-ram: use whole path for region name with >= 3.1 Marc-André Lureau
2018-09-12 12:55 ` [Qemu-devel] [PATCH 1/9] qom/user-creatable: add a few helper macros Marc-André Lureau
2018-10-22 14:33 ` Igor Mammedov
2018-10-26 15:13 ` Eduardo Habkost
2018-10-29 9:56 ` Igor Mammedov
2018-10-30 1:37 ` Eduardo Habkost
2018-10-30 9:26 ` Marc-André Lureau
2018-10-30 14:22 ` Igor Mammedov
2018-10-30 23:07 ` Eduardo Habkost
2018-11-01 12:16 ` Igor Mammedov
2018-11-01 15:02 ` Eduardo Habkost
2018-11-01 15:46 ` Igor Mammedov
2018-09-12 12:55 ` [Qemu-devel] [PATCH 2/9] accel: register global_props like machine globals Marc-André Lureau
2018-10-22 14:47 ` Igor Mammedov
2018-09-12 12:55 ` Marc-André Lureau [this message]
2018-10-22 14:51 ` [Qemu-devel] [PATCH 3/9] qdev: move qdev_prop_register_global_list() to tests Igor Mammedov
2018-09-12 12:55 ` [Qemu-devel] [PATCH 4/9] qom/globals: move qdev globals to qom Marc-André Lureau
2018-09-12 12:55 ` [Qemu-devel] [PATCH 5/9] qom/globals: generalize object_property_set_globals() Marc-André Lureau
2018-10-29 13:11 ` Igor Mammedov
2018-10-30 12:16 ` Marc-André Lureau
2018-10-30 14:05 ` Igor Mammedov
2018-09-12 12:55 ` [Qemu-devel] [PATCH 6/9] qom/object: set globals when initializing object Marc-André Lureau
2018-10-29 12:20 ` Igor Mammedov
2018-09-12 12:55 ` [Qemu-devel] [PATCH 7/9] tests: add user-creatable test to test-qdev-global-props Marc-André Lureau
2018-09-12 12:55 ` [Qemu-devel] [PATCH 8/9] hw/i386: add pc-i440fx-3.1 & pc-q35-3.1 Marc-André Lureau
2018-09-12 12:55 ` [Qemu-devel] [PATCH 9/9] hostmem-ram: use whole path for memory region name with >= 3.1 Marc-André Lureau
2018-09-13 10:19 ` Dr. David Alan Gilbert
2018-10-29 15:16 ` Igor Mammedov
2018-10-02 10:24 ` [Qemu-devel] [PATCH 0/9] hostmem-ram: use whole path for " Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180912125531.32131-4-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=afaerber@suse.de \
--cc=atar4qemu@gmail.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).