From: Thomas Huth <thuth@redhat.com>
To: Michael Labiuk <michael.labiuk@virtuozzo.com>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
den@virtuozzo.com, Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH v4 2/7] tests/x86: Add subtest with 'q35' machine type to device-plug-test
Date: Tue, 27 Sep 2022 12:40:08 +0200 [thread overview]
Message-ID: <965d60c1-09a0-1b70-31dd-f8935996e743@redhat.com> (raw)
In-Reply-To: <20220920104842.605530-3-michael.labiuk@virtuozzo.com>
On 20/09/2022 12.48, Michael Labiuk wrote:
> Configure pci bridge setting to plug pci device and unplug.
>
> Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
> ---
> tests/qtest/device-plug-test.c | 41 ++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
> index e595b45b66..d66c386ef4 100644
> --- a/tests/qtest/device-plug-test.c
> +++ b/tests/qtest/device-plug-test.c
> @@ -90,6 +90,19 @@ static void test_pci_unplug_request(void)
> qtest_quit(qtest);
> }
>
> +static void test_q35_pci_unplug_request(void)
> +{
> +
> + QTestState *qtest = qtest_initf("-machine q35 "
> + "-device pcie-root-port,id=p1 "
> + "-device pcie-pci-bridge,bus=p1,id=b1 "
> + "-device virtio-mouse-pci,bus=b1,id=dev0");
> +
> + process_device_remove(qtest, "dev0");
> +
> + qtest_quit(qtest);
> +}
> +
> static void test_pci_unplug_json_request(void)
> {
> const char *arch = qtest_get_arch();
> @@ -108,6 +121,27 @@ static void test_pci_unplug_json_request(void)
> qtest_quit(qtest);
> }
>
> +static void test_q35_pci_unplug_json_request(void)
> +{
> + const char *port = "-device '{\"driver\": \"pcie-root-port\", "
> + "\"id\": \"p1\"}'";
> +
> + const char *bridge = "-device '{\"driver\": \"pcie-pci-bridge\", "
> + "\"id\": \"b1\", "
> + "\"bus\": \"p1\"}'";
> +
> + const char *device = "-device '{\"driver\": \"virtio-mouse-pci\", "
> + "\"bus\": \"b1\", "
> + "\"id\": \"dev0\"}'";
> +
> + QTestState *qtest = qtest_initf("-machine q35 %s %s %s",
> + port, bridge, device);
> +
> + process_device_remove(qtest, "dev0");
> +
> + qtest_quit(qtest);
> +}
> +
> static void test_ccw_unplug(void)
> {
> QTestState *qtest = qtest_initf("-device virtio-balloon-ccw,id=dev0");
> @@ -187,5 +221,12 @@ int main(int argc, char **argv)
> test_spapr_phb_unplug_request);
> }
>
> + if (!strcmp(arch, "x86_64")) {
We should maybe also add a qtest_has_machine("q35") after the strcmp here
(there have recently been some efforts to make the qtests also run right if
one of the x86 machines has been disabled in the build)
Thomas
> + qtest_add_func("/device-plug/q35-pci-unplug-request",
> + test_q35_pci_unplug_request);
> + qtest_add_func("/device-plug/q35-pci-unplug-json-request",
> + test_q35_pci_unplug_json_request);
> + }
> +
> return g_test_run();
> }
next prev parent reply other threads:[~2022-09-27 10:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 10:48 [PATCH v4 0/7] Add 'q35' machine type to hotplug tests Michael Labiuk via
2022-09-20 10:48 ` [PATCH v4 1/7] tests/x86: Move common code to function in device-plug-test Michael Labiuk via
2022-09-27 10:27 ` Thomas Huth
2022-09-20 10:48 ` [PATCH v4 2/7] tests/x86: Add subtest with 'q35' machine type to device-plug-test Michael Labiuk via
2022-09-27 10:35 ` Thomas Huth
2022-09-27 10:40 ` Thomas Huth [this message]
2022-09-20 10:48 ` [PATCH v4 3/7] tests/x86: Add 'q35' machine type to ivshmem-test Michael Labiuk via
2022-09-27 10:57 ` Thomas Huth
2022-09-20 10:48 ` [PATCH v4 4/7] tests/x86: Add 'q35' machine type to drive_del-test Michael Labiuk via
2022-09-27 12:29 ` Thomas Huth
2022-09-20 10:48 ` [PATCH v4 5/7] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test Michael Labiuk via
2022-09-27 13:00 ` Thomas Huth
2022-09-28 8:37 ` Michael Labiuk
2022-09-20 10:48 ` [PATCH v4 6/7] tests/x86: Refactor hot unplug hd-geo-test Michael Labiuk via
2022-09-20 10:48 ` [PATCH v4 7/7] tests/x86: Add 'q35' machine type to hotplug 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=965d60c1-09a0-1b70-31dd-f8935996e743@redhat.com \
--to=thuth@redhat.com \
--cc=den@virtuozzo.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=michael.labiuk@virtuozzo.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).