vhost-user: print original request on error

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

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2015-11-16 13:55:53 +02:00
parent 87656d5018
commit 5421f318ec

View File

@ -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;
}