[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/42] migration-test: simplify shmem_opts handling
From: |
Peter Xu |
Subject: |
Re: [PATCH 03/42] migration-test: simplify shmem_opts handling |
Date: |
Tue, 20 Jun 2023 11:02:38 -0400 |
On Fri, Jun 09, 2023 at 12:49:04AM +0200, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> tests/qtest/migration-test.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index 73b2f01427..95ccc9bce7 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -681,9 +681,6 @@ static int test_migrate_start(QTestState **from,
> QTestState **to,
> "-object memory-backend-file,id=mem0,size=%s"
> ",mem-path=%s,share=on -numa node,memdev=mem0",
> memory_size, shmem_path);
> - } else {
> - shmem_path = NULL;
> - shmem_opts = g_strdup("");
> }
>
> cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s "
> @@ -696,7 +693,8 @@ static int test_migrate_start(QTestState **from,
> QTestState **to,
> machine_opts ? " -machine " : "",
> machine_opts ? machine_opts : "",
> memory_size, tmpfs,
> - arch_source, shmem_opts,
> + arch_source,
> + shmem_opts ? shmem_opts : "",
> args->opts_source ? args->opts_source : "",
> ignore_stderr ? ignore_stderr : "");
>
> @@ -718,7 +716,8 @@ static int test_migrate_start(QTestState **from,
> QTestState **to,
> machine_opts ? " -machine " : "",
> machine_opts ? machine_opts : "",
> memory_size, tmpfs, uri,
> - arch_target, shmem_opts,
> + arch_target,
> + shmem_opts ? shmem_opts : "",
Isn't this adding duplications instead?
Meanwhile, shmem_opts right now is auto-free. If we do this we don't need
it to be auto-free anymore..
> args->opts_target ? args->opts_target : "",
> ignore_stderr ? ignore_stderr : "");
> *to = qtest_init(cmd_target);
> --
> 2.40.1
>
--
Peter Xu
[PATCH 04/42] migration-test: Make machine_opts regular with other options, Juan Quintela, 2023/06/08
[PATCH 05/42] migration-test: Create arch_opts, Juan Quintela, 2023/06/08
[PATCH 06/42] migration-test: machine_opts is really arch specific, Juan Quintela, 2023/06/08
[PATCH 08/42] migration-test: bootpath is the same for all tests and for all archs, Juan Quintela, 2023/06/08