mirror of https://github.com/xemu-project/xemu.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 <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1543851204-41186-8-git-send-email-pbonzini@redhat.com>
This commit is contained in:
parent
04ad1bf68e
commit
acca950ccd
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue