Message ID | 1479333189-20082-2-git-send-email-stefanha@redhat.com |
---|---|
State | New |
Headers | show |
On Wed, 16 Nov 2016 21:53:07 +0000 Stefan Hajnoczi <stefanha@redhat.com> wrote: > virtio_queue_notify_vq() checks vdev->broken before invoking the > handler, virtio_queue_notify_aio_vq() should too. > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > --- > hw/virtio/virtio.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> I think this makes sense as a fix independent of your other patches.
On Thu, Nov 17, 2016 at 09:31:18AM +0100, Cornelia Huck wrote: > On Wed, 16 Nov 2016 21:53:07 +0000 > Stefan Hajnoczi <stefanha@redhat.com> wrote: > > > virtio_queue_notify_vq() checks vdev->broken before invoking the > > handler, virtio_queue_notify_aio_vq() should too. > > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > > --- > > hw/virtio/virtio.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> > > I think this makes sense as a fix independent of your other patches. I'm not aware of an actual bug caused by this. virtio_queue_pop() returns NULL when the device is broken. This is more for consistency than correctness, so I didn't add qemu-stable, -rc1, or send it as a separate fix.
On Thu, 17 Nov 2016 10:58:30 +0000 Stefan Hajnoczi <stefanha@gmail.com> wrote: > On Thu, Nov 17, 2016 at 09:31:18AM +0100, Cornelia Huck wrote: > > On Wed, 16 Nov 2016 21:53:07 +0000 > > Stefan Hajnoczi <stefanha@redhat.com> wrote: > > > > > virtio_queue_notify_vq() checks vdev->broken before invoking the > > > handler, virtio_queue_notify_aio_vq() should too. > > > > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > > > --- > > > hw/virtio/virtio.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> > > > > I think this makes sense as a fix independent of your other patches. > > I'm not aware of an actual bug caused by this. virtio_queue_pop() > returns NULL when the device is broken. > > This is more for consistency than correctness, so I didn't add > qemu-stable, -rc1, or send it as a separate fix. Fair enough. It was more "we should add this patch even if we don't use the other patches in this series".
On Thu, Nov 17, 2016 at 01:24:47PM +0100, Cornelia Huck wrote: > On Thu, 17 Nov 2016 10:58:30 +0000 > Stefan Hajnoczi <stefanha@gmail.com> wrote: > > > On Thu, Nov 17, 2016 at 09:31:18AM +0100, Cornelia Huck wrote: > > > On Wed, 16 Nov 2016 21:53:07 +0000 > > > Stefan Hajnoczi <stefanha@redhat.com> wrote: > > > > > > > virtio_queue_notify_vq() checks vdev->broken before invoking the > > > > handler, virtio_queue_notify_aio_vq() should too. > > > > > > > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > > > > --- > > > > hw/virtio/virtio.c | 4 ++++ > > > > 1 file changed, 4 insertions(+) > > > > > > Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> > > > > > > I think this makes sense as a fix independent of your other patches. > > > > I'm not aware of an actual bug caused by this. virtio_queue_pop() > > returns NULL when the device is broken. > > > > This is more for consistency than correctness, so I didn't add > > qemu-stable, -rc1, or send it as a separate fix. > > Fair enough. It was more "we should add this patch even if we don't use > the other patches in this series". Okay. Stefan
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 55a00cd..a4759bd 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1239,6 +1239,10 @@ static void virtio_queue_notify_aio_vq(VirtQueue *vq) if (vq->vring.desc && vq->handle_aio_output) { VirtIODevice *vdev = vq->vdev; + if (unlikely(vq->vdev->broken)) { + return; + } + trace_virtio_queue_notify(vdev, vq - vdev->vq, vq); vq->handle_aio_output(vdev, vq); }
virtio_queue_notify_vq() checks vdev->broken before invoking the handler, virtio_queue_notify_aio_vq() should too. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- hw/virtio/virtio.c | 4 ++++ 1 file changed, 4 insertions(+)