From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyIrz-0004Jq-O3 for qemu-devel@nongnu.org; Mon, 16 Nov 2015 07:26:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyIrv-0008AF-MP for qemu-devel@nongnu.org; Mon, 16 Nov 2015 07:26:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyIrv-0008AB-H8 for qemu-devel@nongnu.org; Mon, 16 Nov 2015 07:26:47 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 26F252E54CF for ; Mon, 16 Nov 2015 12:26:47 +0000 (UTC) Received: from redhat.com (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id tAGCQjAg010822 for ; Mon, 16 Nov 2015 07:26:46 -0500 Date: Mon, 16 Nov 2015 14:26:45 +0200 From: "Michael S. Tsirkin" Message-ID: <1447676789-7782-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH v2] vhost-user: print original request on error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org When we get an unexpected response, print out the original request. Helps debug protocol errors tremendously. Signed-off-by: Michael S. Tsirkin --- Changes from v1: add missing . hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 3404b81..5bc6c45 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -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; } -- MST