All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org,  "Michael S. Tsirkin" <mst@redhat.com>,
	bill.mills@linaro.org,  edgar.iglesias@amd.com
Subject: Re: [PATCH v1 2/5] virtio: Add virtio_queue_get_rings
Date: Wed, 05 Nov 2025 12:39:11 +0000	[thread overview]
Message-ID: <875xbovekw.fsf@draig.linaro.org> (raw)
In-Reply-To: <20251028152351.1247812-3-edgar.iglesias@gmail.com> (Edgar E. Iglesias's message of "Tue, 28 Oct 2025 16:23:47 +0100")

"Edgar E. Iglesias" <edgar.iglesias@gmail.com> writes:

> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
>  hw/virtio/virtio.c         | 16 ++++++++++++++++
>  include/hw/virtio/virtio.h |  2 ++
>  2 files changed, 18 insertions(+)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 8a53fb5f93..fe7c635390 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2379,6 +2379,22 @@ void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
>      virtio_init_region_cache(vdev, n);
>  }
>  
> +void virtio_queue_get_rings(VirtIODevice *vdev, int n, hwaddr *desc,
> +                            hwaddr *avail, hwaddr *used)
> +{
> +    assert(vdev->vq[n].vring.num);
> +
> +    if (desc) {
> +        *desc = vdev->vq[n].vring.desc;
> +    }
> +    if (avail) {
> +        *avail = vdev->vq[n].vring.avail;
> +    }
> +    if (used) {
> +        *used = vdev->vq[n].vring.used;
> +    }
> +}
> +
>  void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
>  {
>      /* Don't allow guest to flip queue between existent and
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index d97529c3f1..8bceb115a3 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -361,6 +361,8 @@ int virtio_queue_get_max_num(VirtIODevice *vdev, int n);
>  int virtio_get_num_queues(VirtIODevice *vdev);
>  void virtio_queue_set_rings(VirtIODevice *vdev, int n, hwaddr desc,
>                              hwaddr avail, hwaddr used);
> +void virtio_queue_get_rings(VirtIODevice *vdev, int n, hwaddr *desc,
> +                            hwaddr *avail, hwaddr *used);

Same as last comment, lets start documenting the API.

>  void virtio_queue_update_rings(VirtIODevice *vdev, int n);
>  void virtio_init_region_cache(VirtIODevice *vdev, int n);
>  void virtio_queue_set_align(VirtIODevice *vdev, int n, int align);

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2025-11-05 12:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 15:23 [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 1/5] virtio: Introduce notify_queue Edgar E. Iglesias
2025-11-05 12:38   ` Alex Bennée
2025-11-13 20:43     ` Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 2/5] virtio: Add virtio_queue_get_rings Edgar E. Iglesias
2025-11-05 12:39   ` Alex Bennée [this message]
2025-10-28 15:23 ` [PATCH v1 3/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 4/5] hw/misc: Add generic virtio-msg AMP PCI device Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 5/5] docs: Describe virtio-msg-amp-pci Edgar E. Iglesias
2025-11-05 19:52   ` Alex Bennée
2025-10-28 15:30 ` [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2026-02-03 13:22 ` Michael S. Tsirkin
2026-02-03 17:09   ` Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xbovekw.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=bill.mills@linaro.org \
    --cc=edgar.iglesias@amd.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.