Using get_config_ll_entry in reset_owner don't show any error when the device is not found. This patch fix this by using get_device instead instead of get_config_ll_entry.
Signed-off-by: Jerome Jutteau <jerome.jutteau at outscale.com> --- lib/librte_vhost/virtio-net.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index ec6a575..a6ab245 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -398,18 +398,17 @@ set_owner(struct vhost_device_ctx ctx) static int reset_owner(struct vhost_device_ctx ctx) { - struct virtio_net_config_ll *ll_dev; + struct virtio_net *dev; uint64_t device_fh; - ll_dev = get_config_ll_entry(ctx); - if (ll_dev == NULL) + dev = get_device(ctx); + if (dev == NULL) return -1; - device_fh = ll_dev->dev.device_fh; - - cleanup_device(&ll_dev->dev); - init_device(&ll_dev->dev); - ll_dev->dev.device_fh = device_fh; + device_fh = dev->device_fh; + cleanup_device(dev); + init_device(dev); + dev->device_fh = device_fh; return 0; } -- jerome