aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-12-11 19:18:58 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-12-11 19:18:58 +0000
commitbb9bf94b3e8926553290bc9a7cb84315af422086 (patch)
tree22aa24ec6ba606055a6949844b50d99e73b2d823 /tests
parentab694df6f0f01fca3e2d1e7fca770e3b65cb4a73 (diff)
parent37fdb2c56c603378b85466d1dd64fb4c95f9deb7 (diff)
downloadqemu-bb9bf94b3e8926553290bc9a7cb84315af422086.zip
qemu-bb9bf94b3e8926553290bc9a7cb84315af422086.tar.gz
qemu-bb9bf94b3e8926553290bc9a7cb84315af422086.tar.bz2
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
Machine queue post-3.1.0 (including 4.0 machine-types) Features: * Add 4.0 machine-types to q35/440fx/arm/spapr (Alex Williamson) Documentation: * Document vCPU hotplug procedure (Kashyap Chamarthy) * Deprecate `cpu-add` monitor commands (Kashyap Chamarthy) Bug fixes: * A small sun4v_rtc_write() tracing fix that fell through the cracks (Eduardo Habkost) * Validation of "host-nodes" option on memory backends (Eduardo Habkost) * memory-device fixes and cleanups (David Hildenbrand) Cleanups: * Machine-type code cleanup (remove unnecessary instance_init functions) (Eduardo Habkost) * qdev, qom, and global property code cleanups (Marc-André Lureau) * PCMachineState field renames (Corey Minyard) * numa: Match struct to typedef name (Eric Blake) * hostmem-file: remove object id from pmem error message (Zhang Yi) # gpg: Signature made Tue 11 Dec 2018 17:58:03 GMT # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (24 commits) qom: remove unimplemented class_finalize qdev: move qdev_prop_register_global_list() to tests accel: register global_props like machine globals qom: make user_creatable_complete() specific to UserCreatable qom: make interface types abstract tests: qdev_prop_check_globals() doesn't return "all_used" pc: Use default_machine_opts to set suppress_vmdesc spapr: Delete instance_options functions spapr: Use default_machine_opts to set suppress_vmdesc spapr: Use default_machine_opts to set use_hotplug_event_source virt: Eliminate separate instance_init functions q35/440fx/arm/spapr: Add QEMU 4.0 machine type hostmem: Validate host-nodes before setting bitmap numa: Match struct to typedef name i386: Rename bools in PCMachineState to end in _enabled move ObjectClass to typedefs.h memory-device: avoid overflows on very huge devices memory-device: use QEMU_IS_ALIGNED range: pass const pointer where possible Deprecate HMP `cpu-add` ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/check-qom-interface.c4
-rw-r--r--tests/test-qdev-global-props.c30
2 files changed, 21 insertions, 13 deletions
diff --git a/tests/check-qom-interface.c b/tests/check-qom-interface.c
index f87c9aa..2177f0d 100644
--- a/tests/check-qom-interface.c
+++ b/tests/check-qom-interface.c
@@ -23,9 +23,7 @@
#define TEST_IF(obj) \
INTERFACE_CHECK(TestIf, (obj), TYPE_TEST_IF)
-typedef struct TestIf {
- Object parent_obj;
-} TestIf;
+typedef struct TestIf TestIf;
typedef struct TestIfClass {
InterfaceClass parent_class;
diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
index d81b086..b1eb505 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));
@@ -214,17 +224,17 @@ static void test_dynamic_globalprop_subprocess(void)
{ TYPE_NONDEVICE, "prop6", "106", true },
{}
};
- int all_used;
+ 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));
g_assert_cmpuint(mt->prop1, ==, 101);
g_assert_cmpuint(mt->prop2, ==, 102);
- all_used = qdev_prop_check_globals();
- g_assert_cmpuint(all_used, ==, 1);
+ global_error = qdev_prop_check_globals();
+ g_assert_cmpuint(global_error, ==, 1);
g_assert(props[0].used);
g_assert(props[1].used);
g_assert(!props[2].used);
@@ -259,17 +269,17 @@ static void test_dynamic_globalprop_nouser_subprocess(void)
{ TYPE_NONDEVICE, "prop6", "106" },
{}
};
- int all_used;
+ 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));
g_assert_cmpuint(mt->prop1, ==, 101);
g_assert_cmpuint(mt->prop2, ==, 102);
- all_used = qdev_prop_check_globals();
- g_assert_cmpuint(all_used, ==, 0);
+ 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);
@@ -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));