From: Paolo Bonzini Date: Mon, 3 Dec 2018 15:32:20 +0000 (+0100) Subject: vhost-user-test: signal data_cond when s->rings changes X-Git-Tag: v4.0.0-rc0~114^2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acca950ccded44277037ac765cf6d5003a3d43eb;p=thirdparty%2Fqemu.git 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. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini Message-Id: <1543851204-41186-8-git-send-email-pbonzini@redhat.com> --- diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 9baaff4f24b..8eb79437746 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -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: