qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Zheyu Ma <zheyuma97@gmail.com>
Cc: thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com,
	 qemu-devel@nongnu.org
Subject: Re: [PATCH] libqos/virtio.c: Correct 'flags' reading in qvirtqueue_kick
Date: Wed, 20 Mar 2024 13:40:21 -0400	[thread overview]
Message-ID: <CAJSP0QU5GU56T1ffaAkpdx03aZtM71+e-gEC3uYERxFj991RMA@mail.gmail.com> (raw)
In-Reply-To: <20240320090442.267525-1-zheyuma97@gmail.com>

On Wed, 20 Mar 2024 at 09:10, Zheyu Ma <zheyuma97@gmail.com> wrote:
>
> In qvirtqueue_kick(), the 'flags' were previously being incorrectly read from
> vq->avail instead of the correct vq->used location. This update ensures 'flags'
> are read from the correct location as per the virtio standard.
>
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
>  tests/qtest/libqos/virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

> diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c
> index 82a6e122bf..a21b6eee9c 100644
> --- a/tests/qtest/libqos/virtio.c
> +++ b/tests/qtest/libqos/virtio.c
> @@ -394,7 +394,7 @@ void qvirtqueue_kick(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq,
>      qvirtio_writew(d, qts, vq->avail + 2, idx + 1);
>
>      /* Must read after idx is updated */
> -    flags = qvirtio_readw(d, qts, vq->avail);
> +    flags = qvirtio_readw(d, qts, vq->used);
>      avail_event = qvirtio_readw(d, qts, vq->used + 4 +
>                                  sizeof(struct vring_used_elem) * vq->size);
>
> --
> 2.34.1
>
>


      parent reply	other threads:[~2024-03-20 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  9:04 [PATCH] libqos/virtio.c: Correct 'flags' reading in qvirtqueue_kick Zheyu Ma
2024-03-20 16:55 ` Philippe Mathieu-Daudé
2024-03-20 17:40 ` Stefan Hajnoczi [this message]

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=CAJSP0QU5GU56T1ffaAkpdx03aZtM71+e-gEC3uYERxFj991RMA@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=zheyuma97@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).