test-qdev-global-props creates a few subprocesses and test things based on
qdev realize(). One thing was overlooked since the start, that anonymous
creations of qdev (then realize() the device) requires the machine object's
presence, as all these devices need to be attached to QOM tree, by default
to path "/machine/unattached".
The test didn't crash simply because container_get() has an implicit
semantic to silently create any missing container, hence what happened here
is container_get() (when running these tests) will try to create containers
at QOM path "/machine" on the fly. That's probably unexpected by the test,
but worked like charm before.
We're going to fix device_set_realized() soon, but before that make the
test case prepared, by creating the machine object on its own.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tests/unit/test-qdev-global-props.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)