[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 21/27] vhost-user-test: move wait_for_fds() out
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v8 21/27] vhost-user-test: move wait_for_fds() out |
Date: |
Fri, 9 Oct 2015 17:17:35 +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 v8 02/27] configure: probe for memfd, (continued)
- [Qemu-devel] [PATCH v8 02/27] configure: probe for memfd, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 06/27] util: add memfd helpers, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 05/27] util: add linux-only memfd fallback, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 14/27] vhost: use a function for each call, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 07/27] util: add fallback for qemu_memfd_alloc(), marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 12/27] vhost-user: send log shm fd along with log_base, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 16/27] net: add trace_vhost_user_event, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 18/27] vhost user: add rarp sending after live migration for legacy guest, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 17/27] vhost user: add support of live migration, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 26/27] vhost-user-test: check ownership during migration, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 21/27] vhost-user-test: move wait_for_fds() out,
marcandre . lureau <=
- [Qemu-devel] [PATCH v8 22/27] vhost-user-test: remove useless static check, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 08/27] vhost: document log resizing, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 03/27] linux-headers: add unistd.h, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 11/27] vhost: alloc shareable log, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 15/27] vhost-user: document migration log, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 25/27] vhost-user-test: add live-migration test, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 13/27] vhost-user: add a migration blocker, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 24/27] vhost-user-test: learn to tweak various qemu arguments, marcandre . lureau, 2015/10/09
- [Qemu-devel] [PATCH v8 27/27] seccomp: add memfd_create to whitelist, marcandre . lureau, 2015/10/09