summaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorMaxime Coquelin <maxime.coquelin@redhat.com>2017-05-24 11:05:20 +0200
committerMichael S. Tsirkin <mst@redhat.com>2017-05-25 21:25:28 +0300
commit3cf7daf8c3b0a1c417490741227d910b253796ff (patch)
treef4bca768d9037394f14a4d46e27a2a7e6372b662 /hw/virtio
parent75ebec11afe49539f71cc1c494e3010f91c86adb (diff)
downloadqemu-3cf7daf8c3b0a1c417490741227d910b253796ff.tar.gz
vhost-user: pass message as a pointer to process_message_reply()
process_message_reply() was recently updated to get full message content instead of only its request field. There is no need to copy all the struct content into the stack, so just pass its pointer as const. Reviewed-by: Jens Freimann <jfreiman@redhat.com> Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/vhost-user.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index b87a176770..dde094abb4 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -162,11 +162,11 @@ fail:
}
static int process_message_reply(struct vhost_dev *dev,
- VhostUserMsg msg)
+ const VhostUserMsg *msg)
{
VhostUserMsg msg_reply;
- if ((msg.flags & VHOST_USER_NEED_REPLY_MASK) == 0) {
+ if ((msg->flags & VHOST_USER_NEED_REPLY_MASK) == 0) {
return 0;
}
@@ -174,10 +174,10 @@ static int process_message_reply(struct vhost_dev *dev,
return -1;
}
- if (msg_reply.request != msg.request) {
+ if (msg_reply.request != msg->request) {
error_report("Received unexpected msg type."
"Expected %d received %d",
- msg.request, msg_reply.request);
+ msg->request, msg_reply.request);
return -1;
}
@@ -324,7 +324,7 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev,
}
if (reply_supported) {
- return process_message_reply(dev, msg);
+ return process_message_reply(dev, &msg);
}
return 0;
@@ -716,7 +716,7 @@ static int vhost_user_net_set_mtu(struct vhost_dev *dev, uint16_t mtu)
/* If reply_ack supported, slave has to ack specified MTU is valid */
if (reply_supported) {
- return process_message_reply(dev, msg);
+ return process_message_reply(dev, &msg);
}
return 0;