[PATCH v2 04/13] include/hw/virtio: document virtio_notify_config

Alex Bennée posted 13 patches 2 years, 9 months ago
Maintainers: Mathieu Poirier <mathieu.poirier@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Jason Wang <jasowang@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Viresh Kumar <viresh.kumar@linaro.org>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
[PATCH v2 04/13] include/hw/virtio: document virtio_notify_config
Posted by Alex Bennée 2 years, 9 months ago
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 include/hw/virtio/virtio.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index f236e94ca6..22ec098462 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -274,6 +274,13 @@ extern const VMStateInfo virtio_vmstate_info;
 
 int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id);
 
+/**
+ * virtio_notify_config() - signal a change to device config
+ * @vdev: the virtio device
+ *
+ * Assuming the virtio device is up (VIRTIO_CONFIG_S_DRIVER_OK) this
+ * will trigger a guest interrupt and update the config version.
+ */
 void virtio_notify_config(VirtIODevice *vdev);
 
 bool virtio_queue_get_notification(VirtQueue *vq);
-- 
2.39.2


Re: [PATCH v2 04/13] include/hw/virtio: document virtio_notify_config
Posted by Stefan Hajnoczi 2 years, 8 months ago
On Tue, Apr 18, 2023 at 05:21:31PM +0100, Alex Bennée wrote:
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  include/hw/virtio/virtio.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index f236e94ca6..22ec098462 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -274,6 +274,13 @@ extern const VMStateInfo virtio_vmstate_info;
>  
>  int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id);
>  
> +/**
> + * virtio_notify_config() - signal a change to device config
> + * @vdev: the virtio device

The spec calls this sending a Configuration Change Notification
(https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-1110001).
I suggest using VIRTIO specification terminology, otherwise every person
paraphrases the spec and you have to guess how QEMU code/comments map to
the spec.
Re: [PATCH v2 04/13] include/hw/virtio: document virtio_notify_config
Posted by Mark Cave-Ayland 2 years, 9 months ago
On 18/04/2023 17:21, Alex Bennée wrote:

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   include/hw/virtio/virtio.h | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index f236e94ca6..22ec098462 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -274,6 +274,13 @@ extern const VMStateInfo virtio_vmstate_info;
>   
>   int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id);
>   
> +/**
> + * virtio_notify_config() - signal a change to device config
> + * @vdev: the virtio device
> + *
> + * Assuming the virtio device is up (VIRTIO_CONFIG_S_DRIVER_OK) this
> + * will trigger a guest interrupt and update the config version.
> + */
>   void virtio_notify_config(VirtIODevice *vdev);
>   
>   bool virtio_queue_get_notification(VirtQueue *vq);

I can't 100% vouch for the correctness of the description, however it makes sense to 
me so:

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.