From: Thomas Huth <thuth@redhat.com>
To: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Cc: Bandan Das <bsd@redhat.com>,
Darren Kenny <darren.kenny@oracle.com>,
Alexander Bulekov <alxndr@bu.edu>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>,
Gerd Hoffmann <kraxel@redhat.com>,
Qiuhao Li <Qiuhao.Li@outlook.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually
Date: Tue, 20 Sep 2022 09:55:55 +0200 [thread overview]
Message-ID: <84e511fb-a052-736e-2809-c5a2749ed0a0@redhat.com> (raw)
In-Reply-To: <20220902173452.1904-1-quintela@redhat.com>
On 02/09/2022 19.34, Juan Quintela wrote:
[...]
> There are interesting cases, and are the tests are run with the
> default machine type (pc) but that work with either of them
[...]
> This tests can be run with both machine types, but as we can't easily
> put -machine on them (several of them are supposed to run on other
> architectures), it is not "trivial to fix". I have a "hack" on my
> tree that gets the 1st machine available for this kind of tests and
> changed qtest_init() to qtest_init_first() that does exactly that.
> But I am not sure that is the way to go.
I don't think that this would be a reliable solution, e.g. with
qemu-system-ppc64 or -aarch64, there are plenty of different machine types
and you cannot simply grab the first one to hope that it is good enough to
run the tests.
> Another way for me to fix it
> is just to change the Q35 machine to be the default for x86_64 when
> I400FX is not compiled in, but it has other kind of troubles.
I think there was a consensus in the past to rather get away from default
machine types, so I think that's also the wrong way to go.
> I
> started this wanting than all tests showed an explicit machine type,
> but there is nothing easier to be done for this multiarch tests.
What about this idea: Introduce a "qtest_default_machine()" function that
looks like this:
const char *qtest_default_machine(void)
{
if (g_strequal(arch, "i386") || g_strequal(arch, "x86_64")) {
if (qtest_has_machine("pc")) {
return "-machine pc";
} else if (qtest_has_machine("q35")) {
return "-machine q35";
} else {
abort(); // Or skip the test somehow?
}
}
if (g_strequal(arch, "arm") || g_strequal(arch, "aarch64")) {
/* ARM does not have a default machine, so use "virt" */
if (qtest_has_machine("virt")) {
return "-machine virt";
} else {
abort(); // Or skip the test somehow?
}
// ... similar logic for m68k, riscv, rx, avr and tricore ...
/* For all others use the default machine */
return "";
}
Then you could use this à la:
qts = qtest_init("%s ...", gtest_default_machine(), ...);
Or even add a wrapper function qtest_init_default_machine() for this?
HTH,
Thomas
prev parent reply other threads:[~2022-09-20 7:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
2022-09-04 6:43 ` Ani Sinha
2022-09-04 13:53 ` Philippe Mathieu-Daudé via
2022-09-02 17:34 ` [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type Juan Quintela
2022-09-05 6:22 ` Ani Sinha
2022-09-02 17:34 ` [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in Juan Quintela
2022-09-04 13:57 ` Philippe Mathieu-Daudé via
2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
2022-09-04 14:01 ` Philippe Mathieu-Daudé via
2022-09-05 6:29 ` Ani Sinha
2022-09-02 17:34 ` [PATCH 5/8] tests: sb16 has both pc and q35 tests Juan Quintela
2022-09-02 17:34 ` [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in Juan Quintela
2022-09-11 16:02 ` Thomas Huth
2022-09-02 17:34 ` [PATCH 7/8] tests: Unfold qtest_pci Juan Quintela
2022-09-02 17:34 ` [PATCH 8/8] tests: Make all tests that depend on I440FX state that Juan Quintela
2022-09-20 7:55 ` Thomas Huth [this message]
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=84e511fb-a052-736e-2809-c5a2749ed0a0@redhat.com \
--to=thuth@redhat.com \
--cc=Qiuhao.Li@outlook.com \
--cc=alxndr@bu.edu \
--cc=ani@anisinha.ca \
--cc=bsd@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@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).