Skip to contentSkip to conversation

vhost-user: print original request on error

PATCH Superseded Michael S. Tsirkin 1 participant 1 message Nov 16, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-user: print original request on error

When we get an unexpected response, print out
the original request.
Helps debug protocol errors tremendously.

---
 hw/virtio/vhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/virtio/vhost-user.c +2 -2
index 3404b81..1f81583 100644
@@ -121,8 +121,8 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)
 
     r = qemu_chr_fe_read_all(chr, p, size);
     if (r != size) {
-        error_report("Failed to read msg header. Read %d instead of %d.", r,
-                size);
+        error_report("Failed to read msg header. Read %d instead of %d."
+                     " Original request %d", r, size, msg->request);
         goto fail;
     }
 
Signature · 1 line
MST