From: Michael Labiuk via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
den@virtuozzo.com
Subject: [PATCH v3 2/5] tests/x86: Add 'q35' machine type to ivshmem-test
Date: Thu, 15 Sep 2022 16:14:04 +0300 [thread overview]
Message-ID: <20220915131407.372485-3-michael.labiuk@virtuozzo.com> (raw)
In-Reply-To: <20220915131407.372485-1-michael.labiuk@virtuozzo.com>
Configure pci bridge setting to test ivshmem on 'q35'.
Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
---
tests/qtest/ivshmem-test.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c
index 9611d05eb5..0f9755abc6 100644
--- a/tests/qtest/ivshmem-test.c
+++ b/tests/qtest/ivshmem-test.c
@@ -378,6 +378,32 @@ static void test_ivshmem_server(void)
close(thread.pipe[0]);
}
+static void device_del(QTestState *qtest, const char *id)
+{
+ QDict *resp;
+
+ resp = qtest_qmp(qtest,
+ "{'execute': 'device_del',"
+ " 'arguments': { 'id': %s } }", id);
+
+ g_assert(qdict_haskey(resp, "return"));
+ qobject_unref(resp);
+}
+
+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'}");
+ device_del(qts, "iv1");
+
+ qtest_quit(qts);
+}
+
#define PCI_SLOT_HP 0x06
static void test_ivshmem_hotplug(void)
@@ -469,6 +495,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 +521,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_add_func("/ivshmem/hotplug-q35", test_ivshmem_hotplug_q35);
+ }
out:
ret = g_test_run();
--
2.34.1
next prev parent reply other threads:[~2022-09-15 13:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 13:14 [PATCH v3 0/5] Add 'q35' machine type to hotplug tests Michael Labiuk via
2022-09-15 13:14 ` [PATCH v3 1/5] tests/x86: Add subtest with 'q35' machine type to device-plug-test Michael Labiuk via
2022-09-19 13:07 ` Denis V. Lunev
2022-09-15 13:14 ` Michael Labiuk via [this message]
2022-09-19 13:13 ` [PATCH v3 2/5] tests/x86: Add 'q35' machine type to ivshmem-test Denis V. Lunev
2022-09-19 15:26 ` Michael Labiuk
2022-09-15 13:14 ` [PATCH v3 3/5] tests/x86: Add 'q35' machine type to drive_del-test Michael Labiuk via
2022-09-15 13:14 ` [PATCH v3 4/5] tests/x86: Add 'q35' machine type to hotplug hd-geo-test Michael Labiuk via
2022-09-19 13:19 ` Denis V. Lunev
2022-09-15 13:14 ` [PATCH v3 5/5] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test Michael Labiuk via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220915131407.372485-3-michael.labiuk@virtuozzo.com \
--to=qemu-devel@nongnu.org \
--cc=den@virtuozzo.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=michael.labiuk@virtuozzo.com \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.