qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Fabiano Rosas <farosas@suse.de>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Cc: "Juan Quintela" <quintela@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Leonardo Bras" <leobras@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v4 07/12] tests/qtest/migration: Define a machine for all architectures
Date: Thu, 19 Oct 2023 08:25:41 +0200	[thread overview]
Message-ID: <1b7b78b2-4292-4daa-91a2-79966aa72a9d@redhat.com> (raw)
In-Reply-To: <20231018192741.25885-8-farosas@suse.de>

On 18/10/2023 21.27, Fabiano Rosas wrote:
> Stop relying on defaults and select a machine explicitly for every
> architecture.
> 
> This is a prerequisite for being able to select machine types for
> migration using different QEMU binaries for source and destination.
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>   tests/qtest/migration-test.c | 16 +++++++++++++---
>   1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index e1c110537b..43d0b83771 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -743,6 +743,7 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>       const char *kvm_opts = NULL;
>       const char *arch = qtest_get_arch();
>       const char *memory_size;
> +    const char *machine_alias, *machine_opts = "";
>   
>       if (args->use_shmem) {
>           if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
> @@ -755,11 +756,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>       got_dst_resume = false;
>       if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>           memory_size = "150M";
> +        machine_alias = "pc";
>           arch_opts = g_strdup_printf("-drive file=%s,format=raw", bootpath);
>           start_address = X86_TEST_MEM_START;
>           end_address = X86_TEST_MEM_END;
>       } else if (g_str_equal(arch, "s390x")) {
>           memory_size = "128M";
> +        machine_alias = "s390-ccw-virtio";
>           arch_opts = g_strdup_printf("-bios %s", bootpath);
>           start_address = S390_TEST_MEM_START;
>           end_address = S390_TEST_MEM_END;
> @@ -771,11 +774,14 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>                                         "'nvramrc=hex .\" _\" begin %x %x "
>                                         "do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
>                                         "until'", end_address, start_address);
> -        arch_opts = g_strdup("-nodefaults -machine vsmt=8");
> +        machine_alias = "pseries";
> +        machine_opts = "vsmt=8";
> +        arch_opts = g_strdup("-nodefaults");
>       } else if (strcmp(arch, "aarch64") == 0) {
>           memory_size = "150M";
> -        arch_opts = g_strdup_printf("-machine virt,gic-version=max -cpu max "
> -                                    "-kernel %s", bootpath);
> +        machine_alias = "virt";
> +        machine_opts = "gic-version=max";
> +        arch_opts = g_strdup_printf("-cpu max -kernel %s", bootpath);
>           start_address = ARM_TEST_MEM_START;
>           end_address = ARM_TEST_MEM_END;
>       } else {
> @@ -810,11 +816,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>       }
>   
>       cmd_source = g_strdup_printf("-accel kvm%s -accel tcg "
> +                                 "-machine %s,%s "
>                                    "-name source,debug-threads=on "
>                                    "-m %s "
>                                    "-serial file:%s/src_serial "
>                                    "%s %s %s %s %s",
>                                    kvm_opts ? kvm_opts : "",
> +                                 machine_alias, machine_opts,
>                                    memory_size, tmpfs,
>                                    arch_opts ? arch_opts : "",
>                                    arch_source ? arch_source : "",
> @@ -829,12 +837,14 @@ static int test_migrate_start(QTestState **from, QTestState **to,
>       }
>   
>       cmd_target = g_strdup_printf("-accel kvm%s -accel tcg "
> +                                 "-machine %s,%s "

If machine_opts is empty, there will be a lonely "," at the end of the 
parameter ... seems to work, but it's a little bit ugly.

Anyway:
Reviewed-by: Thomas Huth <thuth@redhat.com>


>                                    "-name target,debug-threads=on "
>                                    "-m %s "
>                                    "-serial file:%s/dest_serial "
>                                    "-incoming %s "
>                                    "%s %s %s %s %s",
>                                    kvm_opts ? kvm_opts : "",
> +                                 machine_alias, machine_opts,
>                                    memory_size, tmpfs, uri,
>                                    arch_opts ? arch_opts : "",
>                                    arch_target ? arch_target : "",



  reply	other threads:[~2023-10-19  6:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 19:27 [PATCH v4 00/12] tests/migration-test: Allow testing older machine types Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 01/12] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 02/12] tests/qtest: Introduce qtest_init_with_env Fabiano Rosas
2023-10-18 20:59   ` Peter Xu
2023-10-19 14:16     ` Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 03/12] tests/qtest: Allow qtest_get_machines to use an alternate QEMU binary Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 04/12] tests/qtest: Introduce qtest_has_machine_with_env Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 05/12] tests/qtest: Introduce qtest_resolve_machine_alias Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 06/12] tests/qtest/migration: Introduce find_common_machine_version Fabiano Rosas
2023-10-19  6:20   ` Thomas Huth
2023-10-18 19:27 ` [PATCH v4 07/12] tests/qtest/migration: Define a machine for all architectures Fabiano Rosas
2023-10-19  6:25   ` Thomas Huth [this message]
2023-10-19  8:07     ` Markus Armbruster
2023-10-19 11:57   ` Juan Quintela
2023-10-18 19:27 ` [PATCH v4 08/12] tests/qtest/migration: Specify the geometry of the bootsector Fabiano Rosas
2023-10-19  6:28   ` Thomas Huth
2023-10-19 11:59   ` Juan Quintela
2023-10-18 19:27 ` [PATCH v4 09/12] tests/qtest/migration: Set q35 as the default machine for x86_86 Fabiano Rosas
2023-10-19  6:28   ` Thomas Huth
2023-10-19 12:00   ` Juan Quintela
2023-10-18 19:27 ` [PATCH v4 10/12] tests/qtest/migration: Support more than one QEMU binary Fabiano Rosas
2023-10-19  6:46   ` Thomas Huth
2023-10-19 11:56     ` Juan Quintela
2023-10-19 14:06     ` Fabiano Rosas
2023-10-18 19:27 ` [PATCH v4 11/12] tests/qtest/migration: Allow user to specify a machine type Fabiano Rosas
2023-10-19  6:57   ` Thomas Huth
2023-10-19 12:06   ` Juan Quintela
2023-10-18 19:27 ` [PATCH v4 12/12] tests/qtest: Don't print messages from query instances Fabiano Rosas
2023-10-19 12:08 ` [PATCH v4 00/12] tests/migration-test: Allow testing older machine types Juan Quintela

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=1b7b78b2-4292-4daa-91a2-79966aa72a9d@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=leobras@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --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).