aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/device-plug-test.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2022-02-15 16:25:32 +0000
committerThomas Huth <thuth@redhat.com>2022-02-21 10:13:23 +0100
commit7b172333f1be916a9bad1f40426dbe944730a9b2 (patch)
tree6a88f04050e0cbca391c0d3e94ce44334dcee5a9 /tests/qtest/device-plug-test.c
parentfedcc3793ef27ad17165536f1aa7e60700eb8067 (diff)
tests/x86: Use 'pc' machine type for hotplug tests
Hotplug tests need a bridge setting up on q35, for now keep them on 'pc'. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220215162537.605030-3-dgilbert@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/device-plug-test.c')
-rw-r--r--tests/qtest/device-plug-test.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index ad79bd4c14..404a92e132 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -63,7 +63,15 @@ static void wait_device_deleted_event(QTestState *qtest, const char *id)
static void test_pci_unplug_request(void)
{
- QTestState *qtest = qtest_initf("-device virtio-mouse-pci,id=dev0");
+ const char *arch = qtest_get_arch();
+ const char *machine_addition = "";
+
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ machine_addition = "-machine pc";
+ }
+
+ QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
+ machine_addition);
/*
* Request device removal. As the guest is not running, the request won't
@@ -79,8 +87,16 @@ static void test_pci_unplug_request(void)
static void test_pci_unplug_json_request(void)
{
+ const char *arch = qtest_get_arch();
+ const char *machine_addition = "";
+
+ if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
+ machine_addition = "-machine pc";
+ }
+
QTestState *qtest = qtest_initf(
- "-device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'");
+ "%s -device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'",
+ machine_addition);
/*
* Request device removal. As the guest is not running, the request won't