vhost-user: check vhost_user_{read,write}() return value
commitc4843a45e3d4f3698b214275ab5e78cdb6a3d212
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 26 Jul 2016 21:15:11 +0000 (27 01:15 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Jul 2016 21:33:48 +0000 (29 00:33 +0300)
tree37c8dfe417699cb054f9e7d8a3a1e31980d687d0
parent6fab2f3f6064ad0a712c6d9213b9151bcc87c3d6
vhost-user: check vhost_user_{read,write}() return value

The vhost-user code is quite inconsistent with error handling. Instead
of ignoring some return values of read/write and silently going on with
invalid state (invalid read for example), break the code flow when the
error happened.

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>
hw/virtio/vhost-user.c