[dpdk-stable] [PATCH v17.11 LTS] vhost: fix payload size of reply

Maxime Coquelin maxime.coquelin at redhat.com
Tue Feb 26 11:21:01 CET 2019


[ upstream commit 57b4d90b5893db2678ca3e28c50e1fcd37bb9b91 ]

QEMU doesn't expect any payload for the reply of
VHOST_USER_SET_LOG_BASE request, so don't send any.
Note that the Vhost-user specification isn't clear about
it and would need to be fixed.

Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")
Cc: stable at dpdk.org

Reported-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost_user.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index d70778b22..74c286e34 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1437,8 +1437,11 @@ vhost_user_msg_handler(int vid, int fd)
 	case VHOST_USER_SET_LOG_BASE:
 		vhost_user_set_log_base(dev, &msg);
 
-		/* it needs a reply */
-		msg.size = sizeof(msg.payload.u64);
+		/*
+		 * The spec is not clear about it (yet), but QEMU doesn't
+		 * expect any payload in the reply.
+		 */
+		msg.size = 0;
 		send_vhost_reply(fd, &msg);
 		break;
 	case VHOST_USER_SET_LOG_FD:
-- 
2.20.1



More information about the stable mailing list