vhost-user: wait until backend init is completed
commitc89804d674e4e3804bd3ac1fe79650896044b4e8
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 26 Jul 2016 21:15:19 +0000 (27 01:15 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Jul 2016 21:33:49 +0000 (29 00:33 +0300)
tree49a50b551ce977c31cd81c1269ff904b51962a7a
parentd7a04fd7d500870ad70f15089c6590e4bea73e70
vhost-user: wait until backend init is completed

The chardev waits for an initial connection before starting qemu, and
vhost-user should wait for the backend negotiation to be completed
before starting qemu too.

vhost-user is started in the net_vhost_user_event callback, which is
synchronously called after the socket is connected. Use a
VhostUserState.started flag to indicate vhost-user init completed
successfully and qemu can be started.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
net/vhost-user.c