libvhost-user: Simplify VHOST_USER_REM_MEM_REG
authorDavid Hildenbrand <david@redhat.com>
Mon, 17 Jan 2022 04:12:32 +0000 (04:12 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 4 Feb 2022 14:07:43 +0000 (09:07 -0500)
commit4fd5ca829ae28f1f009210ab1cd42f86671015ec
treeb07bb831dde4bc34cfbb07d1bce3838d2da3755d
parent9f4e63491ba7ae2f7a537bb98a337f4dcd4e1c54
libvhost-user: Simplify VHOST_USER_REM_MEM_REG

Let's avoid having to manually copy all elements. Copy only the ones
necessary to close the hole and perform the operation in-place without
a second array.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20220117041050.19718-4-raphael.norwitz@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
subprojects/libvhost-user/libvhost-user.c