On Wed, 6 Nov 2024 at 16:05, Stefano Garzarella <sgarzare@redhat.com> wrote:
>+fail_iotlb:
>+ hdev->vhost_ops->vhost_set_iotlb_callback(hdev, false);
> fail_start:
>+ hdev->vhost_ops->vhost_dev_start(hdev, false);
This should go before the fail_start label, since it should not be
called when vhost_dev_start() fails.
* I see, okay.
Also we need to check if that callback is defined.
* That check is already done while reaching the 'goto fail_iotlb;'
statement, no? OR maybe we only check for:
hdev->vhost_ops->vhost_dev_start() function?
>* Looking at the vhost_vdpa_dev_start(), when it is called with
>'started=false' parameter, it calls the vdpa_suspend, vdpa_stop etc.
>functions. ie. probably other ->vhost_dev_start() and
>->vhost_set_iotlb_callback() functions need to take appropriate action
>when called with 'started/enabled=false' parameter.
We already call them in vhost_dev_stop(), so I guess we are fine.
* I meant vhost device functions like vhost_user_dev_start() and
vhost_user_set_iotlb_callback() need to take action when called with a
'false' parameter.