[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 19/24] vhost-user-test: move wait_for_fds() out
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v7 19/24] vhost-user-test: move wait_for_fds() out |
Date: |
Thu, 1 Oct 2015 19:24:03 +0200 |
From: Marc-André Lureau <address@hidden>
This function is a precondition for most vhost-user tests.
Signed-off-by: Marc-André Lureau <address@hidden>
---
tests/vhost-user-test.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 56df5cc..827c0c4 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -126,12 +126,9 @@ static gboolean g_cond_wait_until(CompatGCond cond,
CompatGMutex mutex,
}
#endif
-static void read_guest_mem(void)
+static void wait_for_fds(void)
{
- uint32_t *guest_mem;
gint64 end_time;
- int i, j;
- size_t size;
g_mutex_lock(&data_mutex);
@@ -148,6 +145,19 @@ static void read_guest_mem(void)
g_assert_cmpint(fds_num, >, 0);
g_assert_cmpint(fds_num, ==, memory.nregions);
+ g_mutex_unlock(&data_mutex);
+}
+
+static void read_guest_mem(void)
+{
+ uint32_t *guest_mem;
+ int i, j;
+ size_t size;
+
+ wait_for_fds();
+
+ g_mutex_lock(&data_mutex);
+
/* iterate all regions */
for (i = 0; i < fds_num; i++) {
--
2.4.3
[Qemu-devel] [PATCH v7 02/24] linux-headers: add unistd.h, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 21/24] vhost-user-test: wrap server in TestServer struct, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 22/24] vhost-user-test: learn to tweak various qemu arguments, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 19/24] vhost-user-test: move wait_for_fds() out,
marcandre . lureau <=
[Qemu-devel] [PATCH v7 09/24] vhost: alloc shareable log, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 14/24] net: add trace_vhost_user_event, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 23/24] vhost-user-test: add live-migration test, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 05/24] util: add fallback for qemu_memfd_alloc(), marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 06/24] vhost: document log resizing, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 08/24] vhost-user: add vhost_user_requires_shm_log(), marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 11/24] vhost-user: add a migration blocker, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 10/24] vhost-user: send log shm fd along with log_base, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 13/24] vhost-user: document migration log, marcandre . lureau, 2015/10/08
[Qemu-devel] [PATCH v7 12/24] vhost: use a function for each call, marcandre . lureau, 2015/10/08