Skip to content

Commit

Permalink
vhost-user-test: signal data_cond when s->rings changes
Browse files Browse the repository at this point in the history
This speeds up wait_for_rings_started, which currently is just waiting for
the timeout before checking s->rings.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1543851204-41186-8-git-send-email-pbonzini@redhat.com>
  • Loading branch information
bonzini committed Feb 5, 2019
1 parent 04ad1bf commit acca950
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/vhost-user-test.c
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit acca950

Please sign in to comment.