diff options
author | Michael Labiuk <michael.labiuk@virtuozzo.com> | 2022-09-30 01:35:47 +0300 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2022-10-11 14:06:55 +0200 |
commit | 46d11f9d77b0c0f01fc6f78b2b8e5386abd03209 (patch) | |
tree | 1560af4ae7e59fc091e373061ba985c98108c503 /tests/qtest | |
parent | eb4440ef3aff1206be8e444db7962123bf85cec2 (diff) | |
download | qemu-46d11f9d77b0c0f01fc6f78b2b8e5386abd03209.zip qemu-46d11f9d77b0c0f01fc6f78b2b8e5386abd03209.tar.gz qemu-46d11f9d77b0c0f01fc6f78b2b8e5386abd03209.tar.bz2 |
tests/x86: Add 'q35' machine type to ivshmem-test
Configure pci bridge setting to test ivshmem on 'q35'.
Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
Message-Id: <20220929223547.1429580-10-michael.labiuk@virtuozzo.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r-- | tests/qtest/ivshmem-test.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index 9611d05..cd550c8 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -378,6 +378,20 @@ static void test_ivshmem_server(void) close(thread.pipe[0]); } +static void test_ivshmem_hotplug_q35(void) +{ + QTestState *qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1 " + "-device pcie-root-port,id=p1 " + "-device pcie-pci-bridge,bus=p1,id=b1 " + "-machine q35"); + + qtest_qmp_device_add(qts, "ivshmem-plain", "iv1", + "{'memdev': 'mb1', 'bus': 'b1'}"); + qtest_qmp_device_del_send(qts, "iv1"); + + qtest_quit(qts); +} + #define PCI_SLOT_HP 0x06 static void test_ivshmem_hotplug(void) @@ -469,6 +483,7 @@ int main(int argc, char **argv) { int ret, fd; gchar dir[] = "/tmp/ivshmem-test.XXXXXX"; + const char *arch = qtest_get_arch(); g_test_init(&argc, &argv, NULL); @@ -494,6 +509,9 @@ int main(int argc, char **argv) qtest_add_func("/ivshmem/pair", test_ivshmem_pair); qtest_add_func("/ivshmem/server", test_ivshmem_server); } + if (!strcmp(arch, "x86_64") && qtest_has_machine("q35")) { + qtest_add_func("/ivshmem/hotplug-q35", test_ivshmem_hotplug_q35); + } out: ret = g_test_run(); |