vhost: do not treat empty socket message as error
authorVitaliy Mysak <vitaliy.mysak@intel.com>
Thu, 30 Jan 2020 08:05:39 +0000 (09:05 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 10:47:18 +0000 (11:47 +0100)
commitbedf87c521902d1caeb0974fe9d3344584b849b5
tree83a21e4d28e7ebbdbc44142a579da4504f630d76
parent499fd8e5b89c2ce65d57875d0a7d67f3a7f2fb6b
vhost: do not treat empty socket message as error

According to recvmsg() specification, 0 is a valid
return code when client is disconnecting.
Therefore, it should not be reported as error, unless there
are other dependencies that require message to not be empty.
But there are none, since the next immediate caller of recvmsg()
reports "vhost peer closed" info (not error) when message is empty.

This patch changes return code check for recvmsg() so that
misleading error message is not printed when the code is 0.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/socket.c