[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope |
Date: |
Thu, 19 Jan 2023 15:58:33 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
tests/qtest/migration-test.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 8beeda4686..6c3db95113 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -584,7 +584,6 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
{
g_autofree gchar *arch_source = NULL;
g_autofree gchar *arch_target = NULL;
- g_autofree gchar *cmd_source = NULL;
g_autofree gchar *cmd_target = NULL;
const gchar *ignore_stderr;
g_autofree char *bootpath = NULL;
@@ -672,20 +671,22 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
shmem_opts = g_strdup("");
}
- cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s "
- "-name source,debug-threads=on "
- "-m %s "
- "-serial file:%s/src_serial "
- "%s %s %s %s",
- args->use_dirty_ring ?
- ",dirty-ring-size=4096" : "",
- machine_opts ? " -machine " : "",
- machine_opts ? machine_opts : "",
- memory_size, tmpfs,
- arch_source, shmem_opts,
- args->opts_source ? args->opts_source : "",
- ignore_stderr);
if (!args->only_target) {
+ g_autofree gchar *cmd_source = NULL;
+
+ cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s "
+ "-name source,debug-threads=on "
+ "-m %s "
+ "-serial file:%s/src_serial "
+ "%s %s %s %s",
+ args->use_dirty_ring ?
+ ",dirty-ring-size=4096" : "",
+ machine_opts ? " -machine " : "",
+ machine_opts ? machine_opts : "",
+ memory_size, tmpfs,
+ arch_source, shmem_opts,
+ args->opts_source ? args->opts_source :
"",
+ ignore_stderr);
*from = qtest_init(cmd_source);
}
--
2.38.1
- Re: [PATCH v2 02/11] tests/qtest/boot-serial-test: Simplify test_machine() a bit, (continued)
- [PATCH v2 03/11] tests/qtest/boot-serial-test: Build command line using GString API, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH v2 04/11] tests/qtest/boot-serial-test: Only use available accelerators, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH v2 05/11] tests/qtest/migration-test: Inverse #ifdef'ry ladders, Philippe Mathieu-Daudé, 2023/01/19
- [PATCH v2 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope,
Philippe Mathieu-Daudé <=
- [PATCH v2 07/11] tests/qtest/migration-test: Build command line using GString API (1/4), Philippe Mathieu-Daudé, 2023/01/19
- [PATCH v2 08/11] tests/qtest/migration-test: Build command line using GString API (2/4), Philippe Mathieu-Daudé, 2023/01/19
- [PATCH v2 09/11] tests/qtest/migration-test: Build command line using GString API (3/4), Philippe Mathieu-Daudé, 2023/01/19