qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v2 9/9] tests: use memfd in vhost-user-test
Date: Wed, 11 Jan 2017 12:33:47 +0100	[thread overview]
Message-ID: <20170111113347.7577-10-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20170111113347.7577-1-marcandre.lureau@redhat.com>

This will exercise the memfd memory backend and should generally be
better for testing than memory-backend-file (thanks to anonymous files
and sealing).

The test is already Linux-specific, but will now require Linux with
memfd (since 3.17).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/vhost-user-test.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 96bf00eefa..bf0630e38b 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -39,8 +39,8 @@
 #define HAVE_MONOTONIC_TIME
 #endif
 
-#define QEMU_CMD_MEM    " -m %d -object memory-backend-file,id=mem,size=%dM,"\
-                        "mem-path=%s,share=on -numa node,memdev=mem"
+#define QEMU_CMD_MEM    " -m %d -object memory-backend-memfd,id=mem,size=%dM,"\
+                        " -numa node,memdev=mem"
 #define QEMU_CMD_CHR    " -chardev socket,id=%s,path=%s%s"
 #define QEMU_CMD_NETDEV " -netdev vhost-user,id=net0,chardev=%s,vhostforce"
 #define QEMU_CMD_NET    " -device virtio-net-pci,netdev=net0"
@@ -475,12 +475,12 @@ static inline void test_server_connect(TestServer *server)
     test_server_create_chr(server, ",reconnect=1");
 }
 
-#define GET_QEMU_CMD(s)                                         \
-    g_strdup_printf(QEMU_CMD, 512, 512, (root), (s)->chr_name,  \
+#define GET_QEMU_CMD(s)                                 \
+    g_strdup_printf(QEMU_CMD, 512, 512, (s)->chr_name,  \
                     (s)->socket_path, "", (s)->chr_name)
 
-#define GET_QEMU_CMDE(s, mem, chr_opts, extra, ...)                     \
-    g_strdup_printf(QEMU_CMD extra, (mem), (mem), (root), (s)->chr_name, \
+#define GET_QEMU_CMDE(s, mem, chr_opts, extra, ...)                      \
+    g_strdup_printf(QEMU_CMD extra, (mem), (mem), (s)->chr_name,        \
                     (s)->socket_path, (chr_opts), (s)->chr_name, ##__VA_ARGS__)
 
 static gboolean _test_server_free(TestServer *server)
@@ -883,7 +883,7 @@ static void test_multiqueue(void)
 
     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, root, s->chr_name,
+                          512, 512, s->chr_name,
                           s->socket_path, "", s->chr_name,
                           queues, queues * 2 + 2);
     qtest_start(cmd);
-- 
2.11.0

      parent reply	other threads:[~2017-01-11 11:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 11:33 [Qemu-devel] [PATCH v2 0/9] Add memfd memory backend Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 1/9] exec: check kvm mmu notifiers earlier Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 2/9] exec: split file_ram_alloc() Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 3/9] exec: split qemu_ram_alloc_from_file() Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 4/9] Add memory_region_init_ram_from_fd() Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 5/9] ivshmem: use ram_from_fd() Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 6/9] memory: remove memory_region_set_fd Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 7/9] memfd: split qemu_memfd_alloc() Marc-André Lureau
2017-01-11 11:33 ` [Qemu-devel] [PATCH v2 8/9] Add memfd based hostmem Marc-André Lureau
2017-01-11 11:33 ` Marc-André Lureau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170111113347.7577-10-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).