diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-11-15 10:50:15 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-03-07 17:28:42 +0100 |
commit | 0f9fe58009cfecc263d1eaf1146348abae0e40db (patch) | |
tree | b3dbe14b83e4836233ff2ee6b893deb4f6fa6e04 | |
parent | 6bd4a6d4b867fab1f94f9fe3d1b19d02ac3d684b (diff) |
vhost-user-test: always use 256 MiB of guest memory
Some tests are using a small amount of RAM for the guest (2 MiB) in order to
save host memory, others are using 512 MiB.
However, pSeries machines only support multiples of 256 MiB. Using 256
MiB of memory does not use more host memory than now, even for the
migration test that starts two guests, and it allows running the test on
pSeries too.
This of course is not optimal, it would be nice to let the qgraph machine object
judge how much memory to provide. This is left for future work, together
with a more generic framework that wraps the QEMU command line.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | tests/vhost-user-test.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index b1414e2b44..2a67a99d50 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -704,7 +704,7 @@ static void test_read_guest_mem(const void *arg) "read-guest-memfd" : "read-guest-mem"); test_server_listen(server); - qemu_cmd = get_qemu_cmd(server, 512, memfd, "", ""); + qemu_cmd = get_qemu_cmd(server, 256, memfd, "", ""); s = qtest_start(qemu_cmd); g_free(qemu_cmd); @@ -739,7 +739,7 @@ static void test_migrate(void) test_server_listen(s); test_server_listen(dest); - cmd = get_qemu_cmd(s, 2, TEST_MEMFD_AUTO, "", ""); + cmd = get_qemu_cmd(s, 256, TEST_MEMFD_AUTO, "", ""); from = qtest_start(cmd); g_free(cmd); @@ -749,10 +749,10 @@ static void test_migrate(void) } size = get_log_size(s); - g_assert_cmpint(size, ==, (2 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); + g_assert_cmpint(size, ==, (256 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); tmp = g_strdup_printf(" -incoming %s", uri); - cmd = get_qemu_cmd(dest, 2, TEST_MEMFD_AUTO, "", tmp); + cmd = get_qemu_cmd(dest, 256, TEST_MEMFD_AUTO, "", tmp); g_free(tmp); to = qtest_init(cmd); g_free(cmd); @@ -863,7 +863,7 @@ static void test_reconnect_subprocess(void) char *cmd; g_thread_new("connect", connect_thread, s); - cmd = get_qemu_cmd(s, 2, TEST_MEMFD_AUTO, ",server", ""); + cmd = get_qemu_cmd(s, 256, TEST_MEMFD_AUTO, ",server", ""); qtest_start(cmd); g_free(cmd); @@ -908,7 +908,7 @@ static void test_connect_fail_subprocess(void) s->test_fail = true; g_thread_new("connect", connect_thread, s); - cmd = get_qemu_cmd(s, 2, TEST_MEMFD_AUTO, ",server", ""); + cmd = get_qemu_cmd(s, 256, TEST_MEMFD_AUTO, ",server", ""); qtest_start(cmd); g_free(cmd); @@ -941,7 +941,7 @@ static void test_flags_mismatch_subprocess(void) s->test_flags = TEST_FLAGS_DISCONNECT; g_thread_new("connect", connect_thread, s); - cmd = get_qemu_cmd(s, 2, TEST_MEMFD_AUTO, ",server", ""); + cmd = get_qemu_cmd(s, 256, TEST_MEMFD_AUTO, ",server", ""); qtest_start(cmd); g_free(cmd); @@ -982,14 +982,14 @@ static void test_multiqueue(void) cmd = g_strdup_printf( QEMU_CMD_MEMFD QEMU_CMD_CHR QEMU_CMD_NETDEV ",queues=%d " "-device virtio-net-pci,netdev=net0,mq=on,vectors=%d", - 512, 512, s->chr_name, + 256, 256, s->chr_name, s->socket_path, "", s->chr_name, s->queues, s->queues * 2 + 2); } else { cmd = g_strdup_printf( QEMU_CMD_MEM QEMU_CMD_CHR QEMU_CMD_NETDEV ",queues=%d " "-device virtio-net-pci,netdev=net0,mq=on,vectors=%d", - 512, 512, s->mem_path, s->chr_name, + 256, 256, s->mem_path, s->chr_name, s->socket_path, "", s->chr_name, s->queues, s->queues * 2 + 2); } |