diff options
author | Juan Quintela <quintela@redhat.com> | 2019-12-12 23:20:25 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:23 +0100 |
commit | 1b0237187182f32049831d39c775c93a27a0b3bf (patch) | |
tree | a70dd2eb37f1d328b718d979375a48c00a4e03a0 | |
parent | 8443415f9a09b6d95d99f02733eb71ac4f2d574d (diff) | |
download | qemu-1b0237187182f32049831d39c775c93a27a0b3bf.zip qemu-1b0237187182f32049831d39c775c93a27a0b3bf.tar.gz qemu-1b0237187182f32049831d39c775c93a27a0b3bf.tar.bz2 |
migration-test: Move hide_stderr to common commandline
Signed-off-by: Juan Quintela <quintela@redhat.com>
Tested-by: Cornelia Huck <cohuck@redhat.com> #s390x
Tested-by: Laurent Vivier <lvivier@redhat.com>
-rw-r--r-- | tests/migration-test.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c index fbddcf2..0c01ed3 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -558,6 +558,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, { gchar *cmd_src, *cmd_dst; gchar *cmd_source, *cmd_target; + const gchar *ignore_stderr; char *bootpath = NULL; char *extra_opts = NULL; char *shmem_path = NULL; @@ -661,24 +662,19 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_free(extra_opts); if (hide_stderr) { - gchar *tmp; - tmp = g_strdup_printf("%s 2>/dev/null", cmd_src); - g_free(cmd_src); - cmd_src = tmp; - - tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst); - g_free(cmd_dst); - cmd_dst = tmp; + ignore_stderr = "2>/dev/null"; + } else { + ignore_stderr = ""; } - cmd_source = g_strdup_printf("%s %s", - cmd_src, opts_src); + cmd_source = g_strdup_printf("%s %s %s", + cmd_src, opts_src, ignore_stderr); g_free(cmd_src); *from = qtest_init(cmd_source); g_free(cmd_source); - cmd_target = g_strdup_printf("%s %s", - cmd_dst, opts_dst); + cmd_target = g_strdup_printf("%s %s %s", + cmd_dst, opts_dst, ignore_stderr); g_free(cmd_dst); *to = qtest_init(cmd_target); g_free(cmd_target); |