[dpdk-dev,v2,4/4] vhost: change method to get device in reset_owner
Commit Message
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@outscale.com>
---
lib/librte_vhost/virtio-net.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
@@ -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;
}