mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
qdev: all globals are now user-provided
All globals are now either provided via -global or through -cpu features (CPU features are implemented by registering globals). If the global isn't being used, it should warn in either case. We can thus consider that all global_props are "user-provided" globals. No need to track this per-globals anymore. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
1c3994f6d2
commit
55df8e1a2f
4 changed files with 6 additions and 59 deletions
|
@ -216,12 +216,12 @@ static void test_dynamic_globalprop_subprocess(void)
|
|||
{
|
||||
MyType *mt;
|
||||
static GlobalProperty props[] = {
|
||||
{ TYPE_DYNAMIC_PROPS, "prop1", "101", true },
|
||||
{ TYPE_DYNAMIC_PROPS, "prop2", "102", true },
|
||||
{ TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },
|
||||
{ TYPE_UNUSED_HOTPLUG, "prop4", "104", true },
|
||||
{ TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true },
|
||||
{ TYPE_NONDEVICE, "prop6", "106", true },
|
||||
{ TYPE_DYNAMIC_PROPS, "prop1", "101", },
|
||||
{ TYPE_DYNAMIC_PROPS, "prop2", "102", },
|
||||
{ TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", },
|
||||
{ TYPE_UNUSED_HOTPLUG, "prop4", "104", },
|
||||
{ TYPE_UNUSED_NOHOTPLUG, "prop5", "105", },
|
||||
{ TYPE_NONDEVICE, "prop6", "106", },
|
||||
{}
|
||||
};
|
||||
int global_error;
|
||||
|
@ -256,46 +256,6 @@ static void test_dynamic_globalprop(void)
|
|||
g_test_trap_assert_stdout("");
|
||||
}
|
||||
|
||||
/* Test setting of dynamic properties using user_provided=false properties */
|
||||
static void test_dynamic_globalprop_nouser_subprocess(void)
|
||||
{
|
||||
MyType *mt;
|
||||
static GlobalProperty props[] = {
|
||||
{ TYPE_DYNAMIC_PROPS, "prop1", "101" },
|
||||
{ TYPE_DYNAMIC_PROPS, "prop2", "102" },
|
||||
{ TYPE_DYNAMIC_PROPS"-bad", "prop3", "103" },
|
||||
{ TYPE_UNUSED_HOTPLUG, "prop4", "104" },
|
||||
{ TYPE_UNUSED_NOHOTPLUG, "prop5", "105" },
|
||||
{ TYPE_NONDEVICE, "prop6", "106" },
|
||||
{}
|
||||
};
|
||||
int global_error;
|
||||
|
||||
register_global_properties(props);
|
||||
|
||||
mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));
|
||||
qdev_init_nofail(DEVICE(mt));
|
||||
|
||||
g_assert_cmpuint(mt->prop1, ==, 101);
|
||||
g_assert_cmpuint(mt->prop2, ==, 102);
|
||||
global_error = qdev_prop_check_globals();
|
||||
g_assert_cmpuint(global_error, ==, 0);
|
||||
g_assert(props[0].used);
|
||||
g_assert(props[1].used);
|
||||
g_assert(!props[2].used);
|
||||
g_assert(!props[3].used);
|
||||
g_assert(!props[4].used);
|
||||
g_assert(!props[5].used);
|
||||
}
|
||||
|
||||
static void test_dynamic_globalprop_nouser(void)
|
||||
{
|
||||
g_test_trap_subprocess("/qdev/properties/dynamic/global/nouser/subprocess", 0, 0);
|
||||
g_test_trap_assert_passed();
|
||||
g_test_trap_assert_stderr("");
|
||||
g_test_trap_assert_stdout("");
|
||||
}
|
||||
|
||||
/* Test if global props affecting subclasses are applied in the right order */
|
||||
static void test_subclass_global_props(void)
|
||||
{
|
||||
|
@ -345,11 +305,6 @@ int main(int argc, char **argv)
|
|||
g_test_add_func("/qdev/properties/dynamic/global",
|
||||
test_dynamic_globalprop);
|
||||
|
||||
g_test_add_func("/qdev/properties/dynamic/global/nouser/subprocess",
|
||||
test_dynamic_globalprop_nouser_subprocess);
|
||||
g_test_add_func("/qdev/properties/dynamic/global/nouser",
|
||||
test_dynamic_globalprop_nouser);
|
||||
|
||||
g_test_add_func("/qdev/properties/global/subclass",
|
||||
test_subclass_global_props);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue