[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/71] vhost-user-test: use g_cond_broadcast
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 06/71] vhost-user-test: use g_cond_broadcast |
Date: |
Mon, 3 Dec 2018 16:32:19 +0100 |
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.
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/vhost-user-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 45d58d8..656e519 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -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:
--
1.8.3.1
- [Qemu-devel] [PATCH 04/71] vhost-net: compile it on all targets that have virtio-net., (continued)
- [Qemu-devel] [PATCH 04/71] vhost-net: compile it on all targets that have virtio-net., Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 05/71] vhost-net: revamp configure logic, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 07/71] vhost-user-test: signal data_cond when s->rings changes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 08/71] vhost-user: support cross-endian vnet headers, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 09/71] vhost-user-test: support VHOST_USER_PROTOCOL_F_CROSS_ENDIAN, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 06/71] vhost-user-test: use g_cond_broadcast,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 10/71] vhost-user-test: skip if there is no memory at address 0, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 11/71] vhost-user-test: reduce usage of global_qtest, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 12/71] vhost-user-test: create a main loop per TestServer, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 14/71] vhost-user-test: create a temporary directory per TestServer, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 17/71] tests: remove rule for nonexisting qdev-monitor-test, Paolo Bonzini, 2018/12/03