vhost: preparation for qgraph conversion of vhost-user-test
cover vhost: preparation for qgraph conversion of vhost-user-test
The vhost-user-test is one of the most complex qtests in the tree, and converting it to qgraph poses some unique challenges. This series addresses them in a way that does not depend on the qgraph conversion itself, but prepares for it.
First of all, vhost-user-test is slow and that is a pain when debugging it. :) So patches 1 and 2 fix this bug.
Second, qgraph will be able to test vhost-user-test on pSeries and ARM virt (with virtio-mmio) machine types. Patches 3 and 4 prepares for this by compiling vhost-net even on TCG-only targets, and by supporting wrong-endianness vnet headers. Patches 5 and 6 instead make the test more robust, so that it can run on those machines too.
Third, vhost-user-test is a bit strange in that it has more global state than other tests (in particular a GMainLoop, but also a directory in /tmp and some weird uses of global_qtest). Patches 7 to 10 thus remove this global state already, which simplifies the code and also will reduce the diff for the qgraph conversion.
Please review and ack! Thanks,
Paolo
Paolo Bonzini (10):
vhost-user-test: use g_cond_broadcast
vhost-user-test: signal data_cond when s->rings changes
vhost-net: compile it for all targets
vhost-user: support cross-endian vnet headers
vhost-user-test: support VHOST_USER_PROTOCOL_F_CROSS_ENDIAN
vhost-user-test: skip if there is no memory at address 0
vhost-user-test: reduce usage of global_qtest
vhost-user-test: create a main loop per TestServer
vhost-user-test: small changes to init_hugepagefs
vhost-user-test: create a temporary directory per TestServer
configure | 13 +-- include/exec/poison.h | 1 - net/net.c | 2 +- net/vhost-user.c | 13 +++ tests/Makefile.include | 5 +- tests/vhost-user-test.c | 234 ++++++++++++++++++++++------------------ 6 files changed, 147 insertions(+), 121 deletions(-)
Signature · 1 line
2.19.1
Quoted 1 line
From
478fa5ddebbed4731d4948e00077165d9baeff52Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Mon, 22 Oct 2018 12:54:04 +0200
Subject: [PATCH 01/10] vhost-user-test: use g_cond_broadcast
g_cond_signal is rarely the right thing to do, it works now because vhost-user-test only has two threads but it is not correct in general. Fix it before adding more calls.
--- tests/vhost-user-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/vhost-user-test.c +2 -2
@@ -393,7 +393,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) G_N_ELEMENTS(s->fds));/* signal the test that it can continue */ -g_cond_signal (&s->data_cond); +g_cond_broadcast (&s->data_cond);break ;case VHOST_USER_SET_VRING_KICK :
@@ -419,7 +419,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) p = (uint8_t *) &msg;qemu_chr_fe_write_all (chr, p,VHOST_USER_HDR_SIZE ); -g_cond_signal (&s->data_cond); +g_cond_broadcast (&s->data_cond);break ;case VHOST_USER_SET_VRING_BASE :
Signature · 1 line
2.19.1
Quoted 1 line
From
3e3381f8f1cb8003b34ce089372f8b4c446afa64Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Mon, 22 Oct 2018 12:52:12 +0200
Subject: [PATCH 02/10] vhost-user-test: signal data_cond when s->rings changes
This speeds up wait_for_rings_started, which currently is just waiting for the timeout before checking s->rings.
--- tests/vhost-user-test.c | 2 ++ 1 file changed, 2 insertions(+)
tests/vhost-user-test.c +2 -0
@@ -384,6 +384,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)assert (msg.payload.state.index < s->queues *2 ); s->rings &= ~(0x1ULL << msg.payload.state.index); +g_cond_broadcast (&s->data_cond);break ;case VHOST_USER_SET_MEM_TABLE :
@@ -425,6 +426,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)case VHOST_USER_SET_VRING_BASE :assert (msg.payload.state.index < s->queues *2 ); s->rings |=0x1ULL << msg.payload.state.index; +g_cond_broadcast (&s->data_cond);break ;case VHOST_USER_GET_QUEUE_NUM :
Signature · 1 line
2.19.1
Quoted 1 line
From
0e6e86dae799f7f4404c6dedc8e7d2547a592bebMon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Fri, 26 Oct 2018 11:18:01 +0200
Subject: [PATCH 03/10] vhost-net: compile it for all targets
Currently vhost-net is compiled only for KVM-enabled targets. This is not needed anymore because ioeventfd is supported and emulated by the memory core. Compile it and vhost-user-test for all targets. While at it, fix the annoying typo CONFIG_VHOST_NET_USED.
--- configure | 13 +++++-------- include/exec/poison.h | 1 - net/net.c | 2 +- tests/Makefile.include | 5 +---- 4 files changed, 7 insertions(+), 14 deletions(-)
configure +5 -8
@@ -6512,8 +6512,11 @@ fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi -if test "$vhost_net" = "yes" -a "$vhost_user" = "yes"; then - echo "CONFIG_VHOST_NET_USED=y" >> $config_host_mak +if test "$vhost_net" = "yes" ; then + echo "CONFIG_VHOST_NET=y" >> $config_host_mak + if test "$vhost_user" = "yes"; then + echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak + fi fi if test "$vhost_crypto" = "yes" ; then echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
@@ -7275,12 +7278,6 @@ if supported_xen_target $target; then fi if supported_kvm_target $target; then echo "CONFIG_KVM=y" >> $config_target_mak - if test "$vhost_net" = "yes" ; then - echo "CONFIG_VHOST_NET=y" >> $config_target_mak - if test "$vhost_user" = "yes" ; then - echo "CONFIG_VHOST_USER_NET_TEST_$target_name=y" >> $config_host_mak - fi - fi fi if supported_hax_target $target; then echo "CONFIG_HAX=y" >> $config_target_mak
include/exec/poison.h +0 -1
@@ -85,7 +85,6 @@#pragma GCC poison CONFIG_XTENSA_DIS#pragma GCC poison CONFIG_LINUX_USER -#pragma GCC poison CONFIG_VHOST_NET#pragma GCC poison CONFIG_KVM#pragma GCC poison CONFIG_SOFTMMU
net/net.c +1 -1
@@ -955,7 +955,7 @@ static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])( [NET_CLIENT_DRIVER_BRIDGE] = net_init_bridge, #endif [NET_CLIENT_DRIVER_HUBPORT ] = net_init_hubport, -#ifdef CONFIG_VHOST_NET_USED +#ifdef CONFIG_VHOST_NET_USER [NET_CLIENT_DRIVER_VHOST_USER ] = net_init_vhost_user, #endif #ifdef CONFIG_L2TPV3
tests/Makefile.include +1 -4
@@ -204,10 +204,7 @@ check-qtest-i386-$(CONFIG_USB_XHCI_NEC) += tests/usb-hcd-xhci-test$(EXESUF) check-qtest-i386-y += tests/cpu-plug-test$(EXESUF) check-qtest-i386-y += tests/q35-test$(EXESUF) check-qtest-i386-y += tests/vmgenid-test$(EXESUF) -check-qtest-i386-$(CONFIG_VHOST_USER_NET_TEST_i386) += tests/vhost-user-test$(EXESUF) -ifeq ($(CONFIG_VHOST_USER_NET_TEST_i386),) -check-qtest-x86_64-$(CONFIG_VHOST_USER_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF) -endif +check-qtest-i386-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_CRB) += tests/tpm-crb-swtpm-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_CRB) += tests/tpm-crb-test$(EXESUF) check-qtest-i386-$(CONFIG_TPM_TIS) += tests/tpm-tis-swtpm-test$(EXESUF)
Signature · 1 line
2.19.1
Quoted 1 line
From
24da32afab4433aec7ab61d39523a2f6ed2f7db6Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 09:29:03 +0100
Subject: [PATCH 04/10] vhost-user: support cross-endian vnet headers
vhost-user already has a way to communicate the endianness of the guest via the vring endianness messages. The vring endianness always matches the vnet header endianness so there is no need to do anything else in the backend.
--- net/vhost-user.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/vhost-user.c +13 -0
@@ -172,6 +172,17 @@ static void net_vhost_user_cleanup(NetClientState *nc)qemu_purge_queued_packets (nc); } +static int vhost_user_set_vnet_endianness (NetClientState *nc, +bool enable) +{ +/* Nothing to do. If the server supports +* VHOST_USER_PROTOCOL_F_CROSS_ENDIAN, it will get the +* vnet header endianness from there. If it doesn't, negotiation +* fails. +*/ +return 0 ; +} +static bool vhost_user_has_vnet_hdr (NetClientState *nc) {assert (nc->info->type ==NET_CLIENT_DRIVER_VHOST_USER );
@@ -193,6 +204,8 @@ static NetClientInfo net_vhost_user_info = { .cleanup = net_vhost_user_cleanup, .has_vnet_hdr = vhost_user_has_vnet_hdr, .has_ufo = vhost_user_has_ufo, + .set_vnet_be = vhost_user_set_vnet_endianness, + .set_vnet_le = vhost_user_set_vnet_endianness, }; static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond,
Signature · 1 line
2.19.1
Quoted 1 line
From
247409366d7ee6d2a8098977b8cebb5e20dbfac7Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 09:30:23 +0100
Subject: [PATCH 05/10] vhost-user-test: support
VHOST_USER_PROTOCOL_F_CROSS_ENDIAN
This will be useful to run the qtest for ppc64 targets on (for example) x86_64 hosts.
--- tests/vhost-user-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
tests/vhost-user-test.c +5 -3
@@ -51,6 +51,7 @@#define VHOST_USER_F_PROTOCOL_FEATURES 30#define VHOST_USER_PROTOCOL_F_MQ 0#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1 +#define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6#define VHOST_LOG_PAGE 0x1000
@@ -251,7 +252,7 @@ static void wait_for_fds(TestServer *s)static void read_guest_mem_server (TestServer *s) { -uint32_t *guest_mem; +uint8_t *guest_mem;int i, j;size_t size;
@@ -278,8 +279,8 @@ static void read_guest_mem_server(TestServer *s)g_assert (guest_mem !=MAP_FAILED ); guest_mem += (s->memory.regions[i].mmap_offset /sizeof (*guest_mem)); -for (j =0 ; j <256 ; j++) { -uint32_t a =readl (s->memory.regions[i].guest_phys_addr + j*4 ); +for (j =0 ; j <1024 ; j++) { +uint32_t a =readb (s->memory.regions[i].guest_phys_addr + j);uint32_t b = guest_mem[j]; g_assert_cmpint(a, ==, b);
@@ -367,6 +368,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size) msg.flags |=VHOST_USER_REPLY_MASK ; msg.size =sizeof (m.payload.u64); msg.payload.u64 =1 <<VHOST_USER_PROTOCOL_F_LOG_SHMFD ; + msg.payload.u64 |=1 <<VHOST_USER_PROTOCOL_F_CROSS_ENDIAN ;if (s->queues >1 ) { msg.payload.u64 |=1 <<VHOST_USER_PROTOCOL_F_MQ ; }
Signature · 1 line
2.19.1
Quoted 1 line
From
f0afa82c6878678b3c7f1f73098494e1110a2b1bMon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 09:50:19 +0100
Subject: [PATCH 06/10] vhost-user-test: skip if there is no memory at address
0
The virt machine cannot run the vhost-user qtests because they hardcode the presence of memory at address 0. Report the tests as a skip so that they can be converted to use qgraph.
--- tests/vhost-user-test.c | 58 ++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-)
tests/vhost-user-test.c +45 -13
147 lines not on this page · raw message
Signature · 1 line
2.19.1
Quoted 1 line
From
f0015ff92d653ce72ebd1873ff62c1c9265dde86Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 10:17:47 +0100
Subject: [PATCH 07/10] vhost-user-test: reduce usage of global_qtest
Whenever the code can run on multiple QTestStates, use them explicitly instead of global_qtest.
--- tests/vhost-user-test.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-)
tests/vhost-user-test.c +17 -21
@@ -187,12 +187,12 @@ static char *get_qemu_cmd(TestServer *s, } } -static void init_virtio_dev (TestServer *s,uint32_t features_mask) +static void init_virtio_dev (QTestState *qts,TestServer *s,uint32_t features_mask) {uint32_t features;int i; - s->bus =qpci_init_pc (global_qtest,NULL ); + s->bus =qpci_init_pc (qts,NULL );g_assert_nonnull (s->bus); s->dev =qvirtio_pci_device_find (s->bus,VIRTIO_ID_NET );
@@ -203,7 +203,7 @@ static void init_virtio_dev(TestServer *s, uint32_t features_mask)qvirtio_set_acknowledge (&s->dev->vdev);qvirtio_set_driver (&s->dev->vdev); - s->alloc =pc_alloc_init (global_qtest); + s->alloc =pc_alloc_init (qts);for (i =0 ; i < s->queues *2 ; i++) { s->vq[i] =qvirtqueue_setup (&s->dev->vdev, s->alloc, i);
@@ -265,7 +265,7 @@ static bool wait_for_fds(TestServer *s)return got_region; } -static void read_guest_mem_server (TestServer *s) +static void read_guest_mem_server (QTestState *qts,TestServer *s) {uint8_t *guest_mem;int i, j;
@@ -293,7 +293,7 @@ static void read_guest_mem_server(TestServer *s) guest_mem += (s->memory.regions[i].mmap_offset /sizeof (*guest_mem));for (j =0 ; j <1024 ; j++) { -uint32_t a =readb (s->memory.regions[i].guest_phys_addr + j); +uint32_t a =qtest_readb (qts, s->memory.regions[i].guest_phys_addr + j);uint32_t b = guest_mem[j]; g_assert_cmpint(a, ==, b);
@@ -670,13 +670,13 @@ static void test_read_guest_mem(const void *arg) s =qtest_start (qemu_cmd);g_free (qemu_cmd); -init_virtio_dev (server,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (global_qtest, server,1u <<VIRTIO_NET_F_MAC );if (!wait_for_fds (server)) { goto exit; } -read_guest_mem_server (server); +read_guest_mem_server (global_qtest, server); exit:uninit_virtio_dev (server);
@@ -690,7 +690,7 @@ static void test_migrate(void)TestServer *s =test_server_new ("src" );TestServer *dest =test_server_new ("dest" );char *uri =g_strdup_printf ("%s%s" ,"unix:" , dest->mig_path); -QTestState *global = global_qtest, *from, *to; +QTestState *from, *to;GSource *source;gchar *cmd, *tmp;QDict *rsp;
@@ -704,7 +704,7 @@ static void test_migrate(void) from =qtest_start (cmd);g_free (cmd); -init_virtio_dev (s,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (from, s,1u <<VIRTIO_NET_F_MAC );if (!wait_for_fds (s)) { goto exit; }
@@ -717,7 +717,7 @@ static void test_migrate(void)g_free (tmp); to =qtest_init (cmd);g_free (cmd); -init_virtio_dev (dest,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (to, dest,1u <<VIRTIO_NET_F_MAC ); source =g_source_new (&test_migrate_source_funcs,sizeof (TestMigrateSource));
@@ -753,12 +753,10 @@ static void test_migrate(void)qobject_unref (rsp);qmp_eventwait ("STOP" ); +qtest_qmp_eventwait (to,"RESUME" ); - global_qtest = to; -qmp_eventwait ("RESUME" ); - -g_assert (wait_for_fds (s)); -read_guest_mem_server (dest); +g_assert (wait_for_fds (dest)); +read_guest_mem_server (to, dest);uninit_virtio_dev (dest);qtest_quit (to);
@@ -773,8 +771,6 @@ exit:qtest_quit (from);test_server_free (s);g_free (uri); - - global_qtest = global; }static void wait_for_rings_started (TestServer *s,size_t count)
@@ -831,7 +827,7 @@ static void test_reconnect_subprocess(void)qtest_start (cmd);g_free (cmd); -init_virtio_dev (s,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (global_qtest, s,1u <<VIRTIO_NET_F_MAC );if (!wait_for_fds (s)) { goto exit; }
@@ -873,7 +869,7 @@ static void test_connect_fail_subprocess(void)qtest_start (cmd);g_free (cmd); -init_virtio_dev (s,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (global_qtest, s,1u <<VIRTIO_NET_F_MAC );if (!wait_for_fds (s)) { goto exit; }
@@ -906,7 +902,7 @@ static void test_flags_mismatch_subprocess(void)qtest_start (cmd);g_free (cmd); -init_virtio_dev (s,1u <<VIRTIO_NET_F_MAC ); +init_virtio_dev (global_qtest, s,1u <<VIRTIO_NET_F_MAC );if (!wait_for_fds (s)) { goto exit; }
@@ -957,7 +953,7 @@ static void test_multiqueue(void)qtest_start (cmd);g_free (cmd); -init_virtio_dev (s, features_mask); +init_virtio_dev (global_qtest, s, features_mask);wait_for_rings_started (s, s->queues *2 );
Signature · 1 line
2.19.1
Quoted 1 line
From
c2aead639b37f8e228d75aceddb4b8910fe76712Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 11:06:01 +0100
Subject: [PATCH 08/10] vhost-user-test: create a main loop per TestServer
This makes the tests more independent and removes the need to defer test_server_free via an idle event source.
--- tests/vhost-user-test.c | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-)
tests/vhost-user-test.c +16 -22
@@ -143,6 +143,8 @@ typedef struct TestServer {int fds_num;int fds[VHOST_MEMORY_MAX_NREGIONS ];VhostUserMemory memory; +GMainLoop *loop; +GThread *thread;GMutex data_mutex;GCond data_cond;int log_fd;
@@ -490,6 +492,10 @@ static TestServer *test_server_new(const gchar *name) {TestServer *server =g_new0 (TestServer,1 ); + server->loop =g_main_loop_new (NULL , FALSE); +/* run the main loop thread so the chardev may operate */ + server->thread =g_thread_new (NULL , thread_function, server->loop); + server->socket_path =g_strdup_printf ("%s/%s.sock" , tmpfs, name); server->mig_path =g_strdup_printf ("%s/%s.mig" , tmpfs, name); server->chr_name =g_strdup_printf ("chr-%s" , name);
@@ -533,9 +539,18 @@ static void test_server_listen(TestServer *server)test_server_create_chr (server,",server,nowait" ); } -static gboolean _test_server_free (TestServer *server) +static void test_server_free (TestServer *server) {int i; +int ret; + +/* finish the helper thread and dispatch pending sources */ +g_main_loop_quit (server->loop); +g_thread_join (server->thread); +while (g_main_context_pending (NULL )) { +g_main_context_iteration (NULL , TRUE); + } +g_main_loop_unref (server->loop);qemu_chr_fe_deinit (&server->chr, true);
@@ -558,13 +573,6 @@ static gboolean _test_server_free(TestServer *server)qpci_free_pc (server->bus);g_free (server); - -return FALSE; -} - -static void test_server_free (TestServer *server) -{ -g_idle_add ((GSourceFunc )_test_server_free, server); }static void wait_for_log_fd (TestServer *s)
@@ -969,8 +977,6 @@ int main(int argc, char **argv)const char *hugefs;int ret;char template[] ="/tmp/vhost-test-XXXXXX" ; -GMainLoop *loop; -GThread *thread;g_test_init (&argc, &argv,NULL );
@@ -991,10 +997,6 @@ int main(int argc, char **argv) root = tmpfs; } - loop =g_main_loop_new (NULL , FALSE); -/* run the main loop thread so the chardev may operate */ - thread =g_thread_new (NULL , thread_function, loop); -if (qemu_memfd_check (0 )) { qtest_add_data_func("/vhost-user/read-guest-mem/memfd", GINT_TO_POINTER(TEST_MEMFD_YES),
@@ -1022,14 +1024,6 @@ int main(int argc, char **argv)/* cleanup */ -/* finish the helper thread and dispatch pending sources */ -g_main_loop_quit (loop); -g_thread_join (thread); -while (g_main_context_pending (NULL )) { -g_main_context_iteration (NULL , TRUE); - } -g_main_loop_unref (loop); - ret =rmdir (tmpfs);if (ret !=0 ) { g_test_message("unable to rmdir: path (%s): %s\n",
Signature · 1 line
2.19.1
Quoted 1 line
From
8cd2ae9f308831668d5e950454386077f81caa00Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 10:07:41 +0100
Subject: [PATCH 09/10] vhost-user-test: small changes to init_hugepagefs
After the conversion to qgraph, the equivalent of "main" will be in a constructor and will run even if the tests are not being requested. Therefore, it should not assert that init_hugepagefs succeeds and will be called when creating the TestServer. This patch changes the prototype of init_hugepagefs, this way the next patch looks nicer.
--- tests/vhost-user-test.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
tests/vhost-user-test.c +10 -9
@@ -461,13 +461,19 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)g_mutex_unlock (&s->data_mutex); } -static const char *init_hugepagefs (const char *path) +static const char *init_hugepagefs (void ) { +const char *path =getenv ("QTEST_HUGETLBFS_PATH" );struct statfs fs;int ret; +if (!path) { +return NULL ; + } +if (access (path,R_OK |W_OK |X_OK )) {g_test_message ("access on path (%s): %s\n" , path,strerror (errno)); +abort ();return NULL ; }
@@ -477,11 +483,13 @@ static const char *init_hugepagefs(const char *path)if (ret !=0 ) {g_test_message ("statfs on path (%s): %s\n" , path,strerror (errno)); +abort ();return NULL ; }if (fs.f_type !=HUGETLBFS_MAGIC ) {g_test_message ("Warning: path not on HugeTLBFS: %s\n" , path); +abort ();return NULL ; }
@@ -974,7 +982,6 @@ static void test_multiqueue(void)int main (int argc,char **argv) { -const char *hugefs;int ret;char template[] ="/tmp/vhost-test-XXXXXX" ;
@@ -989,13 +996,7 @@ int main(int argc, char **argv) }g_assert (tmpfs); - hugefs =getenv ("QTEST_HUGETLBFS_PATH" ); -if (hugefs) { - root =init_hugepagefs (hugefs); -g_assert (root); - }else { - root = tmpfs; - } + root =init_hugepagefs () ? : tmpfs;if (qemu_memfd_check (0 )) { qtest_add_data_func("/vhost-user/read-guest-mem/memfd",
Signature · 1 line
2.19.1
Quoted 1 line
From
b1094edbde802a7872bbbd1d6bc9594e716f0d53Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <[email protected]>
Date: Thu, 15 Nov 2018 13:42:32 +0100
Subject: [PATCH 10/10] vhost-user-test: create a temporary directory per
TestServer
This makes the tests more independent, and also the source and destination TestServers in the migration test.
--- tests/vhost-user-test.c | 75 +++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 41 deletions(-)
tests/vhost-user-test.c +34 -41
179 lines not on this page · raw message
Signature · 1 line
2.19.1