vhost: refine new device function
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Fri, 8 Jun 2018 09:18:04 +0000 (02:18 -0700)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 15 Jun 2018 07:49:09 +0000 (09:49 +0200)
commit76b1e4cec7dc15b733966f9f494d7d49e4f016f2
treede0061d8dd62aa42d3305f8907c9fc5e8b287d61
parent0e677a35349f316d50ba25485354363f3e65c12e
vhost: refine new device function

Make sure find avalid device id before allocating
virtio_net, if not, return directly. It may avoid
allocating and freeing virtio_net when there is
not valid device id.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.c