summaryrefslogtreecommitdiffstats
path: root/tests/test-qdev-global-props.c
Commit message (Collapse)AuthorAgeFilesLines
* qdev: Move global validation to a single functionEduardo Habkost2014-09-181-11/+55
| | | | | | | | | | | | | | | | | | | Currently GlobalProperty.not_used=false has multiple meanings: * It may be a property for a hotpluggable device, which may or may not have been used by a device; * It may be a machine-type-provided property, which may or may not have been used by a device. * It may be a user-provided property that was actually not used by any device. Simplify the logic by having two separate fields: 'user_provided' and 'used'. This allows the entire global property validation logic to be contained in a single function, and allows more specific error messages. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals()Eduardo Habkost2014-09-181-1/+1
| | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* test-qdev-global-props: Test handling of hotpluggable and non-device typesEduardo Habkost2014-09-181-0/+55
| | | | | | | | | Ensure no warning will be printed for hotpluggable types, and warnings will be printed for non-device types. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* test-qdev-global-props: Initialize not_used=true for all propsEduardo Habkost2014-09-181-2/+5
| | | | | | | | | This will ensure we are actually testing the code which sets not_used=false when the property is used. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* test-qdev-global-props: Run tests on subprocessEduardo Habkost2014-09-181-6/+43
| | | | | | | | | | | | | | | | There are multiple reasons for running the global property tests on a subprocess: * We need the global_props lists to be empty for each test case, so global properties from the previous test won't affect the next one; * We don't want the qdev_prop_check_global() warnings to pollute test output; * With a subprocess, we can ensure qdev_prop_check_global() is printing the warning messages it should. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* test-qdev-global-props: Trivial comment fixEduardo Habkost2014-09-141-1/+1
| | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qdev: Add test of qdev_prop_check_globalDon Slutz2014-06-051-0/+4
| | | | | | | | | | | | | | | This will generate a warning from "make check": ... GTESTER tests/test-qdev-global-props Warning: "-global dynamic-prop-type-bad.prop3=103" not used GTESTER tests/check-qom-interface ... If the warning is not generated, the test will fail. Signed-off-by: Don Slutz <dslutz@verizon.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
* qdev: Set globals in instance_post_init functionEduardo Habkost2013-08-161-0/+73
| | | | | | | | | | This way, properties registered in the instance_init function of child classes will be handled properly by qdev_prop_set_globals(), too. Includes a unit test for the new functionality. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* tests: Unit tests for qdev global properties handlingEduardo Habkost2013-08-161-0/+107
This tests the qdev global-properties handling code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
OpenPOWER on IntegriCloud