Refactor vhost_user_set_mem_table functions
commit2d9da9dff35765fc3c0f5a67da04a38066897650
authorRaphael Norwitz <raphael.norwitz@nutanix.com>
Wed, 25 Mar 2020 10:35:06 +0000 (25 06:35 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 4 May 2020 14:25:03 +0000 (4 10:25 -0400)
treefa70174237cc322f3018f7ff92fdb5fbd00fc9f1
parente302bb3da6b59ad22c2157bbaac299a301780ba1
Refactor vhost_user_set_mem_table functions

vhost_user_set_mem_table() and vhost_user_set_mem_table_postcopy() have
gotten convoluted, and have some identical code.

This change moves the logic populating the VhostUserMemory struct and
fds array from vhost_user_set_mem_table() and
vhost_user_set_mem_table_postcopy() to a new function,
vhost_user_fill_set_mem_table_msg().

No functionality is impacted.

Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com>
Message-Id: <1585132506-13316-1-git-send-email-raphael.norwitz@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-user.c