diff options
author | Thomas Huth <thuth@redhat.com> | 2018-10-09 11:51:17 +0200 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2018-10-11 19:58:21 +0100 |
commit | 5571dc824b3a8b9e890caa721a6938970e7596ed (patch) | |
tree | a7a95ae4172423c7e54db93ab13a05d5411c8a2c /tests/migration-test.c | |
parent | c02b37814cf6962b3320ab34e1b3a26a2323772f (diff) |
tests/migration: Enable the migration test on s390x, too
We can re-use the s390-ccw bios code to implement a small firmware
for a s390x guest which prints out the "A" and "B" characters and
modifies the memory, as required for the migration test.
[quintela: Converted the compile script to Makefile rules]
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1539078677-25396-1-git-send-email-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixed up Makefile since the aarch patch sneaked in first
Diffstat (limited to 'tests/migration-test.c')
-rw-r--r-- | tests/migration-test.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c index 5bdc0bd519..b7920255c5 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -96,6 +96,17 @@ static void init_bootfile(const char *bootpath, void *content) fclose(bootfile); } +#include "tests/migration/s390x/a-b-bios.h" + +static void init_bootfile_s390x(const char *bootpath) +{ + FILE *bootfile = fopen(bootpath, "wb"); + size_t len = sizeof(s390x_elf); + + g_assert_cmpint(fwrite(s390x_elf, len, 1, bootfile), ==, 1); + fclose(bootfile); +} + /* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's @@ -443,6 +454,19 @@ static int test_migrate_start(QTestState **from, QTestState **to, accel, tmpfs, bootpath, uri); start_address = X86_TEST_MEM_START; end_address = X86_TEST_MEM_END; + } else if (g_str_equal(arch, "s390x")) { + init_bootfile_s390x(bootpath); + cmd_src = g_strdup_printf("-machine accel=%s -m 128M" + " -name source,debug-threads=on" + " -serial file:%s/src_serial -bios %s", + accel, tmpfs, bootpath); + cmd_dst = g_strdup_printf("-machine accel=%s -m 128M" + " -name target,debug-threads=on" + " -serial file:%s/dest_serial -bios %s" + " -incoming %s", + accel, tmpfs, bootpath, uri); + start_address = S390_TEST_MEM_START; + end_address = S390_TEST_MEM_END; } else if (strcmp(arch, "ppc64") == 0) { cmd_src = g_strdup_printf("-machine accel=%s -m 256M -nodefaults" " -name source,debug-threads=on" |