From: Paolo Bonzini <pbonzini@redhat.com>
To: P J P <ppandit@redhat.com>, Qemu Developers <qemu-devel@nongnu.org>
Cc: zhangboxian <zhangboxian@huawei.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Prasad J Pandit <pjp@fedoraproject.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] virtio: check VirtQueue Vring object is set
Date: Fri, 24 Nov 2017 00:39:15 +0100 [thread overview]
Message-ID: <adb78e77-491a-c899-8454-d628b845cd29@redhat.com> (raw)
In-Reply-To: <20171123190131.5138-2-ppandit@redhat.com>
On 23/11/2017 20:01, P J P wrote:
> @@ -182,7 +182,7 @@ void virtio_queue_update_rings(VirtIODevice *vdev, int n)
> {
> VRing *vring = &vdev->vq[n].vring;
>
> - if (!vring->desc) {
> + if (!vring->desc || !vring->align) {
> /* not yet setup -> nothing to do */
> return;
> }
> @@ -1414,6 +1414,9 @@ void virtio_config_modern_writel(VirtIODevice *vdev,
>
> void virtio_queue_set_addr(VirtIODevice *vdev, int n, hwaddr addr)
> {
> + if (!vdev->vq[n].vring.num) {
> + return;
> + }
Why not check vring->num in virtio_queue_update_rings too?
Thanks,
Paolo
> vdev->vq[n].vring.desc = addr;
> virtio_queue_update_rings(vdev, n);
> }
next prev parent reply other threads:[~2017-11-23 23:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 19:01 [Qemu-devel] [PATCH 0/2] check VirtiQueue Vring objects P J P
2017-11-23 19:01 ` [Qemu-devel] [PATCH 1/2] virtio: check VirtQueue Vring object is set P J P
2017-11-23 23:39 ` Paolo Bonzini [this message]
2017-11-24 7:59 ` P J P
2017-11-23 19:01 ` [Qemu-devel] [PATCH 2/2] tests: add test to check VirtQueue object P J P
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=adb78e77-491a-c899-8454-d628b845cd29@redhat.com \
--to=pbonzini@redhat.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhangboxian@huawei.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 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.