vhost: initialize postcopy ufd properly
authorTiwei Bie <tiwei.bie@intel.com>
Wed, 24 Oct 2018 09:39:48 +0000 (17:39 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 26 Oct 2018 20:14:06 +0000 (22:14 +0200)
commit0dcdf32e642df5b2f3a82d3ebd639322b147c0ca
tree94494b8187a7433f6eb997535a681106beb5f36f
parente988a6d84599f83321f8036dc45acf26a97ad7ea
vhost: initialize postcopy ufd properly

Currently, postcopy_ufd is initialized to 0 implicitly, so fd 0
could be closed unexpectedly by vhost_backend_cleanup(). Fix this
issue by initializing postcopy_ufd to -1 explicitly.

Fixes: 9eefef3b5970 ("vhost: introduce postcopy advise message")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.c