[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/62] migration-test: Move memory size to common commandline
From: |
Paolo Bonzini |
Subject: |
[PULL 05/62] migration-test: Move memory size to common commandline |
Date: |
Mon, 16 Dec 2019 17:27:49 +0100 |
From: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
Tested-by: Cornelia Huck <address@hidden> #s390x
Tested-by: Laurent Vivier <address@hidden>
---
tests/migration-test.c | 44 +++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 39203f6..18857f0 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -565,6 +565,7 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
const char *arch = qtest_get_arch();
const char *machine_type;
const char *machine_args;
+ const char *memory_size;
opts_src = opts_src ? opts_src : "";
opts_dst = opts_dst ? opts_dst : "";
@@ -585,15 +586,14 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
init_bootfile(bootpath, x86_bootsect, sizeof(x86_bootsect));
machine_type = "";
machine_args = "";
- extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-m 150M"
- " -name source,debug-threads=on"
+ memory_size = "150M";
+ extra_opts = use_shmem ? get_shmem_opts(memory_size, shmem_path) :
NULL;
+ cmd_src = g_strdup_printf(" -name source,debug-threads=on"
" -serial file:%s/src_serial"
" -drive file=%s,format=raw %s",
tmpfs, bootpath,
extra_opts ? extra_opts : "");
- cmd_dst = g_strdup_printf("-m 150M"
- " -name target,debug-threads=on"
+ cmd_dst = g_strdup_printf(" -name target,debug-threads=on"
" -serial file:%s/dest_serial"
" -drive file=%s,format=raw"
" -incoming %s %s",
@@ -605,14 +605,13 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
init_bootfile(bootpath, s390x_elf, sizeof(s390x_elf));
machine_type = "";
machine_args = "";
- extra_opts = use_shmem ? get_shmem_opts("128M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-m 128M"
- " -name source,debug-threads=on"
+ memory_size = "128M";
+ extra_opts = use_shmem ? get_shmem_opts(memory_size, shmem_path) :
NULL;
+ cmd_src = g_strdup_printf(" -name source,debug-threads=on"
" -serial file:%s/src_serial -bios %s %s",
tmpfs, bootpath,
extra_opts ? extra_opts : "");
- cmd_dst = g_strdup_printf("-m 128M"
- " -name target,debug-threads=on"
+ cmd_dst = g_strdup_printf(" -name target,debug-threads=on"
" -serial file:%s/dest_serial -bios %s"
" -incoming %s %s",
tmpfs, bootpath, uri,
@@ -622,8 +621,9 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
} else if (strcmp(arch, "ppc64") == 0) {
machine_type = "";
machine_args = ",vsmt=8";
- extra_opts = use_shmem ? get_shmem_opts("256M", shmem_path) : NULL;
- cmd_src = g_strdup_printf("-m 256M -nodefaults"
+ memory_size = "256M";
+ extra_opts = use_shmem ? get_shmem_opts(memory_size, shmem_path) :
NULL;
+ cmd_src = g_strdup_printf("-nodefaults"
" -name source,debug-threads=on"
" -serial file:%s/src_serial"
" -prom-env 'use-nvramrc?=true' -prom-env "
@@ -631,8 +631,7 @@ static int test_migrate_start(QTestState **from, QTestState
**to,
"do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
"until' %s", tmpfs, end_address,
start_address, extra_opts ? extra_opts : "");
- cmd_dst = g_strdup_printf("-m 256M"
- " -name target,debug-threads=on"
+ cmd_dst = g_strdup_printf(" -name target,debug-threads=on"
" -serial file:%s/dest_serial"
" -incoming %s %s",
tmpfs, uri,
@@ -644,14 +643,15 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
init_bootfile(bootpath, aarch64_kernel, sizeof(aarch64_kernel));
machine_type = "virt,";
machine_args = "gic-version=max";
- extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL;
+ memory_size = "150M";
+ extra_opts = use_shmem ? get_shmem_opts(memory_size, shmem_path) :
NULL;
cmd_src = g_strdup_printf("-name vmsource,debug-threads=on -cpu max "
- "-m 150M -serial file:%s/src_serial "
+ "-serial file:%s/src_serial "
"-kernel %s %s",
tmpfs, bootpath,
extra_opts ? extra_opts : "");
cmd_dst = g_strdup_printf("-name vmdest,debug-threads=on -cpu max "
- "-m 150M -serial file:%s/dest_serial "
+ "-serial file:%s/dest_serial "
"-kernel %s "
"-incoming %s %s",
tmpfs, bootpath, uri,
@@ -674,15 +674,21 @@ static int test_migrate_start(QTestState **from,
QTestState **to,
ignore_stderr = "";
}
- cmd_source = g_strdup_printf("-machine %saccel=kvm:tcg%s %s %s %s",
+ cmd_source = g_strdup_printf("-machine %saccel=kvm:tcg%s "
+ "-m %s "
+ "%s %s %s",
machine_type, machine_args,
+ memory_size,
cmd_src, opts_src, ignore_stderr);
g_free(cmd_src);
*from = qtest_init(cmd_source);
g_free(cmd_source);
- cmd_target = g_strdup_printf("-machine %saccel=kvm:tcg%s %s %s %s",
+ cmd_target = g_strdup_printf("-machine %saccel=kvm:tcg%s "
+ "-m %s "
+ "%s %s %s",
machine_type, machine_args,
+ memory_size,
cmd_dst, opts_dst, ignore_stderr);
g_free(cmd_dst);
*to = qtest_init(cmd_target);
--
1.8.3.1
- [PULL 00/62] Misc patches for 2019-12-16, Paolo Bonzini, 2019/12/16
- [PULL 01/62] kvm: Reallocate dirty_bmap when we change a slot, Paolo Bonzini, 2019/12/16
- [PULL 02/62] migration-test: Create cmd_soure and cmd_target, Paolo Bonzini, 2019/12/16
- [PULL 03/62] migration-test: Move hide_stderr to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 04/62] migration-test: Move -machine to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 05/62] migration-test: Move memory size to common commandline,
Paolo Bonzini <=
- [PULL 06/62] migration-test: Move shmem handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 07/62] migration-test: Move -name handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 09/62] migration-test: Move -incomming handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 08/62] migration-test: Move -serial handling to common commandline, Paolo Bonzini, 2019/12/16
- [PULL 10/62] migration-test: Rename cmd_src/dst to arch_source/arch_target, Paolo Bonzini, 2019/12/16
- [PULL 12/62] memory: do not look at current_machine->accel, Paolo Bonzini, 2019/12/16
- [PULL 11/62] migration-test: Use a struct for test_migrate_start parameters, Paolo Bonzini, 2019/12/16
- [PULL 13/62] vl: move icount configuration earlier, Paolo Bonzini, 2019/12/16
- [PULL 15/62] vl: extract accelerator option processing to a separate function, Paolo Bonzini, 2019/12/16
- [PULL 14/62] tcg: move qemu_tcg_configure to accel/tcg/tcg-all.c, Paolo Bonzini, 2019/12/16