Daniel P. Berrangé <berrange@redhat.com> wrote:
On Wed, Oct 04, 2023 at 12:59:49PM -0300, Fabiano Rosas wrote:
Juan Quintela <quintela@redhat.com> writes:
Fabiano Rosas <farosas@suse.de> wrote:
Daniel P. Berrangé <berrange@redhat.com> writes:
On Tue, Oct 03, 2023 at 05:24:50PM +0200, Philippe Mathieu-Daudé wrote:
[...]
I'm working on a cleanup of this patch to make it more integrated with
libqtest. If we teach qtest_get_machines() to sometimes refresh the list
of machines then it becomes way less code.
I think that it is just easier to pass the machine type we want to test
to whatever script we have. Specially where [sane] architectures like
arm don't have a default machine type (no, I haven't double checked if
that has changed lately).
We still need to enforce the same machine type for both binaries and a
sane range of QEMU versions. I think our docs state that we only support
migration from QEMU n->n+1 and vice versa? If the test will know what
combinations are allowed, it could just go ahead and use those.
Query the 'pc' (or 'q35' as appropriate) alias on both QEMU versions,
to resolve them into versioned machines.
Then find which resolved machine version(s) exist in both QEMUs, and
prefer the src machine if multiple matches exist.
We only change Machine Type with each qemu version, so having to change
it by hand don't look so complicated.
Let's assume for a moment that "pc" and "q35" machine types don't exist
(rest of architectures needs to do a similar thing)
latest qemu has:
pc-i440fx-8.2 Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-8.1 Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-8.0 Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-7.2 Standard PC (i440FX + PIIX, 1996) (default)
Previous version one has everything except 8.2
We want to test:
(this is what we do now)
qemu-8.2 -M pc-i440fx-8.2 -> qemu-8.2 -M pc-i440fx-8.2
And we want to test additionally:
qemu-8.1 -M pc-i440fx-8.1 -> qemu-8.2 -M pc-i440fx-8.1
qemu-8.2 -M pc-i440fx-8.1 -> qemu-8.1 -M pc-i440fx-8.1
And that is it.
So the thing that we need is a sane way to get qtest_init() to use the
right machine type without inventing what machine type they want. Not
having a default machine type has other advantages, but that is a
different discussion.