From: Fabiano Rosas <farosas@suse.de>
To: Steve Sistare <steven.sistare@oracle.com>, qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>,
Steve Sistare <steven.sistare@oracle.com>
Subject: Re: [PATCH] migration-test: fix migrate_args
Date: Wed, 01 Oct 2025 11:05:06 -0300 [thread overview]
Message-ID: <874isid8fh.fsf@suse.de> (raw)
In-Reply-To: <1759324985-369944-1-git-send-email-steven.sistare@oracle.com>
Steve Sistare <steven.sistare@oracle.com> writes:
> migrate_args calls g_test_skip, but that does not end the test.
> It must also return an error code. This fixes the queued patch
> "migration-test: migrate_args".
>
> Suggested-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> ---
> tests/qtest/migration/framework.c | 9 ++++++---
> tests/qtest/migration/framework.h | 2 +-
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
> index 2dfb1ee..8044b2a 100644
> --- a/tests/qtest/migration/framework.c
> +++ b/tests/qtest/migration/framework.c
> @@ -258,7 +258,7 @@ static char *test_shmem_path(void)
> return g_strdup_printf("/dev/shm/qemu-%d", getpid());
> }
>
> -void migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
> +int migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
> {
> /* options for source and target */
> g_autofree gchar *arch_opts = NULL;
> @@ -351,7 +351,7 @@ void migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
> if (!qtest_has_machine(machine_alias)) {
> g_autofree char *msg = g_strdup_printf("machine %s not supported", machine_alias);
> g_test_skip(msg);
> - return;
> + return -1;
> }
>
> machine = resolve_machine_version(machine_alias, QEMU_ENV_SRC,
> @@ -398,6 +398,7 @@ void migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
>
> *from = cmd_source;
> *to = cmd_target;
> + return 0;
> }
>
> int migrate_start(QTestState **from, QTestState **to, const char *uri,
> @@ -419,7 +420,9 @@ int migrate_start(QTestState **from, QTestState **to, const char *uri,
> bootfile_create(qtest_get_arch(), tmpfs, args->suspend_me);
> src_state.suspend_me = args->suspend_me;
>
> - migrate_args(&cmd_source, &cmd_target, uri, args);
> + if (migrate_args(&cmd_source, &cmd_target, uri, args)) {
> + return -1;
> + }
>
> if (!args->only_target) {
> *from = qtest_init_ext(QEMU_ENV_SRC, cmd_source, capabilities, true);
> diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/framework.h
> index 51a8a7e..ad5ca57 100644
> --- a/tests/qtest/migration/framework.h
> +++ b/tests/qtest/migration/framework.h
> @@ -227,7 +227,7 @@ void wait_for_serial(const char *side);
> void migrate_prepare_for_dirty_mem(QTestState *from);
> void migrate_wait_for_dirty_mem(QTestState *from, QTestState *to);
>
> -void migrate_args(char **from, char **to, const char *uri, MigrateStart *args);
> +int migrate_args(char **from, char **to, const char *uri, MigrateStart *args);
> int migrate_start(QTestState **from, QTestState **to, const char *uri,
> MigrateStart *args);
> void migrate_end(QTestState *from, QTestState *to, bool test_dest);
Thanks!
prev parent reply other threads:[~2025-10-01 14:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 13:23 [PATCH] migration-test: fix migrate_args Steve Sistare
2025-10-01 14:05 ` Fabiano Rosas [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=874isid8fh.fsf@suse.de \
--to=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=steven.sistare@oracle.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.