mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
libvhost-user: Report descriptor index on panic
We want to report the index of the descriptor, not its pointer. Fixes:7b2e5c65f4
("contrib: add libvhost-user") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200723171935.18535-1-philmd@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit8fe9805c73
) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
committed by
Michael Roth
parent
d8f0b2bbf4
commit
eca194d43c
@ -1867,7 +1867,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
|
|||||||
|
|
||||||
/* If their number is silly, that's a fatal mistake. */
|
/* If their number is silly, that's a fatal mistake. */
|
||||||
if (*head >= vq->vring.num) {
|
if (*head >= vq->vring.num) {
|
||||||
vu_panic(dev, "Guest says index %u is available", head);
|
vu_panic(dev, "Guest says index %u is available", *head);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1926,7 +1926,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
|
|||||||
smp_wmb();
|
smp_wmb();
|
||||||
|
|
||||||
if (*next >= max) {
|
if (*next >= max) {
|
||||||
vu_panic(dev, "Desc next is %u", next);
|
vu_panic(dev, "Desc next is %u", *next);
|
||||||
return VIRTQUEUE_READ_DESC_ERROR;
|
return VIRTQUEUE_READ_DESC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user