summaryrefslogtreecommitdiff
path: root/lib/librte_vhost
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2018-10-24 17:39:48 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:06 +0200
commit0dcdf32e642df5b2f3a82d3ebd639322b147c0ca (patch)
tree94494b8187a7433f6eb997535a681106beb5f36f /lib/librte_vhost
parente988a6d84599f83321f8036dc45acf26a97ad7ea (diff)
downloaddpdk-0dcdf32e642df5b2f3a82d3ebd639322b147c0ca.zip
dpdk-0dcdf32e642df5b2f3a82d3ebd639322b147c0ca.tar.gz
dpdk-0dcdf32e642df5b2f3a82d3ebd639322b147c0ca.tar.xz
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>
Diffstat (limited to 'lib/librte_vhost')
-rw-r--r--lib/librte_vhost/vhost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 047ee53..70ac6bc 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -344,6 +344,7 @@ vhost_new_device(void)
dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET;
dev->slave_req_fd = -1;
dev->vdpa_dev_id = -1;
+ dev->postcopy_ufd = -1;
rte_spinlock_init(&dev->slave_req_lock);
return i;