diff mbox series

[3/5] log: Add more details to virtio_report in virtqueue_pop

Message ID 20200806093720.2355692-4-liangpeng10@huawei.com (mailing list archive)
State New, archived
Headers show
Series log: Add logs for some modules | expand

Commit Message

Peng Liang Aug. 6, 2020, 9:37 a.m. UTC
Add virtio device name and virtqueue info to virtio_report in
virtqueue_pop so that we can find out which device's virtqueue is
broken.

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
---
 hw/virtio/virtio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index f3568f5267..6b35bed1d7 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1439,7 +1439,9 @@  static void *virtqueue_split_pop(VirtQueue *vq, size_t sz)
     max = vq->vring.num;
 
     if (vq->inuse >= vq->vring.num) {
-        virtio_error(vdev, "Virtqueue size exceeded");
+        virtio_error(vdev, "Virtio device %s vq->inuse=%d vq->vring.num=%d, "
+                     "virtqueue size exceeded",
+                     vdev->name, vq->inuse, vq->vring.num);
         goto done;
     }