On Wed, 6 Nov 2024 at 17:31, Stefano Garzarella <sgarz...@redhat.com> wrote:
> For vhost_set_iotlb_callback() that is true because for now we go to
> that label only if the callback is defined, but this is not the case for
> hdev->vhost_ops->vhost_dev_start().
>
> Anyway if in the future we add a new step that need to go on that label
> we may forgot to remember that, so since it's not a hot path, I'd add
> both checks as we do in vhost_dev_stop().

* Okay.

> IIUC in vhost_dev_stop() we already call both of them with a 'false'
> parameter, so that functions should be already prepared or am I missing
> something?
===
static int vhost_user_dev_start(struct vhost_dev *dev, bool started)
{
    ...
    if (started) {
        return vhost_user_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE |
                                          VIRTIO_CONFIG_S_DRIVER |
                                          VIRTIO_CONFIG_S_DRIVER_OK);
    } else {
        return 0;
    }
}
static void vhost_user_set_iotlb_callback(struct vhost_dev *dev, int enabled)
{
    /* No-op as the receive channel is not dedicated to IOTLB messages. */
}
===

* vhost_user_dev_start and vhost_user_set_iotlb_callback() don't seem
to do much when called with 'false' parameter.

Thank you.
---
  - Prasad


Reply via email to