tests: cpu-plug-test: fix device_add for pc/q35 machines
commit021a007efc31d99416335f73a3c8f1b9183e0047
authorIgor Mammedov <imammedo@redhat.com>
Fri, 30 Aug 2019 11:07:23 +0000 (30 07:07 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 15 Oct 2019 21:18:08 +0000 (15 18:18 -0300)
tree2e89031ae577c143c04e7a3ea0b0dd5f8e36374f
parentb4510bb4109f5fad478fb238b0ab11be7d2bc2fd
tests: cpu-plug-test: fix device_add for pc/q35 machines

Commit bc1fb850a3 silently broke device_add test for CPU hotplug which
resulted in test successfully passing though it wasn't actually run.
Fix it by making sure that all non present CPUs reported
by "query-hotpluggable-cpus" are hotplugged instead of making up
and hardcoding values.

Use of query-hotpluggable-cpus also allows consolidatiate device_add
cpu testcases and reuse the same test function for all targets.

While at it also add a check that at least one CPU was hotplugged,
to avoid silent breakage in the future.

Fixes: bc1fb850a3 (vl.c deprecate incorrect CPUs topology)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20190830110723.15096-3-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
tests/cpu-plug-test.c