diff options
author | Juan Quintela <quintela@redhat.com> | 2019-12-12 23:20:24 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:23 +0100 |
commit | 8443415f9a09b6d95d99f02733eb71ac4f2d574d (patch) | |
tree | c41e9e03b7aa16d4e1951d993d1ea581b8c23c7d /tests | |
parent | 9b3a31c745b61758aaa5466a3a9fc0526d409188 (diff) | |
download | qemu-8443415f9a09b6d95d99f02733eb71ac4f2d574d.zip qemu-8443415f9a09b6d95d99f02733eb71ac4f2d574d.tar.gz qemu-8443415f9a09b6d95d99f02733eb71ac4f2d574d.tar.bz2 |
migration-test: Create cmd_soure and cmd_target
We are repeating almost everything for each machine while creating the
command line for migration. And once for source and another for
destination. We start putting there opts_src and opts_dst.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Tested-by: Cornelia Huck <cohuck@redhat.com> #s390x
Tested-by: Laurent Vivier <lvivier@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/migration-test.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c index a5343fd..fbddcf2 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -557,6 +557,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, const char *opts_dst) { gchar *cmd_src, *cmd_dst; + gchar *cmd_source, *cmd_target; char *bootpath = NULL; char *extra_opts = NULL; char *shmem_path = NULL; @@ -584,16 +585,16 @@ static int test_migrate_start(QTestState **from, QTestState **to, cmd_src = g_strdup_printf("-machine accel=%s -m 150M" " -name source,debug-threads=on" " -serial file:%s/src_serial" - " -drive file=%s,format=raw %s %s", + " -drive file=%s,format=raw %s", accel, tmpfs, bootpath, - extra_opts ? extra_opts : "", opts_src); + extra_opts ? extra_opts : ""); cmd_dst = g_strdup_printf("-machine accel=%s -m 150M" " -name target,debug-threads=on" " -serial file:%s/dest_serial" " -drive file=%s,format=raw" - " -incoming %s %s %s", + " -incoming %s %s", accel, tmpfs, bootpath, uri, - extra_opts ? extra_opts : "", opts_dst); + extra_opts ? extra_opts : ""); start_address = X86_TEST_MEM_START; end_address = X86_TEST_MEM_END; } else if (g_str_equal(arch, "s390x")) { @@ -601,15 +602,15 @@ static int test_migrate_start(QTestState **from, QTestState **to, extra_opts = use_shmem ? get_shmem_opts("128M", shmem_path) : NULL; cmd_src = g_strdup_printf("-machine accel=%s -m 128M" " -name source,debug-threads=on" - " -serial file:%s/src_serial -bios %s %s %s", + " -serial file:%s/src_serial -bios %s %s", accel, tmpfs, bootpath, - extra_opts ? extra_opts : "", opts_src); + extra_opts ? extra_opts : ""); cmd_dst = g_strdup_printf("-machine accel=%s -m 128M" " -name target,debug-threads=on" " -serial file:%s/dest_serial -bios %s" - " -incoming %s %s %s", + " -incoming %s %s", accel, tmpfs, bootpath, uri, - extra_opts ? extra_opts : "", opts_dst); + extra_opts ? extra_opts : ""); start_address = S390_TEST_MEM_START; end_address = S390_TEST_MEM_END; } else if (strcmp(arch, "ppc64") == 0) { @@ -620,15 +621,14 @@ static int test_migrate_start(QTestState **from, QTestState **to, " -prom-env 'use-nvramrc?=true' -prom-env " "'nvramrc=hex .\" _\" begin %x %x " "do i c@ 1 + i c! 1000 +loop .\" B\" 0 " - "until' %s %s", accel, tmpfs, end_address, - start_address, extra_opts ? extra_opts : "", - opts_src); + "until' %s", accel, tmpfs, end_address, + start_address, extra_opts ? extra_opts : ""); cmd_dst = g_strdup_printf("-machine accel=%s,vsmt=8 -m 256M" " -name target,debug-threads=on" " -serial file:%s/dest_serial" - " -incoming %s %s %s", + " -incoming %s %s", accel, tmpfs, uri, - extra_opts ? extra_opts : "", opts_dst); + extra_opts ? extra_opts : ""); start_address = PPC_TEST_MEM_START; end_address = PPC_TEST_MEM_END; @@ -638,16 +638,16 @@ static int test_migrate_start(QTestState **from, QTestState **to, cmd_src = g_strdup_printf("-machine virt,accel=%s,gic-version=max " "-name vmsource,debug-threads=on -cpu max " "-m 150M -serial file:%s/src_serial " - "-kernel %s %s %s", + "-kernel %s %s", accel, tmpfs, bootpath, - extra_opts ? extra_opts : "", opts_src); + extra_opts ? extra_opts : ""); cmd_dst = g_strdup_printf("-machine virt,accel=%s,gic-version=max " "-name vmdest,debug-threads=on -cpu max " "-m 150M -serial file:%s/dest_serial " "-kernel %s " - "-incoming %s %s %s", + "-incoming %s %s", accel, tmpfs, bootpath, uri, - extra_opts ? extra_opts : "", opts_dst); + extra_opts ? extra_opts : ""); start_address = ARM_TEST_MEM_START; end_address = ARM_TEST_MEM_END; @@ -671,11 +671,17 @@ static int test_migrate_start(QTestState **from, QTestState **to, cmd_dst = tmp; } - *from = qtest_init(cmd_src); + cmd_source = g_strdup_printf("%s %s", + cmd_src, opts_src); g_free(cmd_src); + *from = qtest_init(cmd_source); + g_free(cmd_source); - *to = qtest_init(cmd_dst); + cmd_target = g_strdup_printf("%s %s", + cmd_dst, opts_dst); g_free(cmd_dst); + *to = qtest_init(cmd_target); + g_free(cmd_target); /* * Remove shmem file immediately to avoid memory leak in test failed case. |