@samitouri / QOSamiQemu / commits / 060ed6a4bb

vhost_user.rst: Add GET_SHMEM_CONFIG message

Add GET_SHMEM_CONFIG vhost-user frontend message to the spec documentation. Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Alyssa Ross <hi@alyssa.is> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Albert Esteve <aesteve@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260304165223.2166175-6-aesteve@redhat.com>

Albert Esteve committed Mar 4, 2026 at 17:52 UTC 060ed6a4bb4d50e3de257a29137e84843f069312
1 file changed +39
docs/interop/vhost-user.rst
+39
@@ -384,6 +384,22 @@ MMAP request
384 - 0: Pages are mapped read-only
385 - 1: Pages are mapped read-write
386
387 +VIRTIO Shared Memory Region configuration
388 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
389 +
390 ++-------------+---------+------------+----+--------------+
391 +| num regions | padding | mem size 0 | .. | mem size 255 |
392 ++-------------+---------+------------+----+--------------+
393 +
394 +:num regions: a 32-bit number of regions
395 +
396 +:padding: 32-bit
397 +
398 +:mem size: an array of 256 64-bit fields representing the size of each
399 + VIRTIO Shared Memory Region. ``num regions`` specifies the
400 + number of valid regions (non-zero size). The array index
401 + corresponds to the shared memory ID (shmid).
402 +
403 C structure
404 -----------
405
@@ -410,6 +426,7 @@ In QEMU the vhost-user message is implemented with the following struct:
426 VhostUserShared object;
427 VhostUserTransferDeviceState transfer_state;
428 VhostUserMMap mmap;
429 + VhostUserShMemConfig shmem;
430 };
431 } QEMU_PACKED VhostUserMsg;
432
@@ -1794,6 +1811,28 @@ Front-end message types
1811 Using this function requires prior negotiation of the
1812 ``VHOST_USER_PROTOCOL_F_DEVICE_STATE`` feature.
1813
1814 +``VHOST_USER_GET_SHMEM_CONFIG``
1815 + :id: 44
1816 + :equivalent ioctl: N/A
1817 + :request payload: N/A
1818 + :reply payload: ``struct VhostUserShMemConfig``
1819 +
1820 + When the ``VHOST_USER_PROTOCOL_F_SHMEM`` protocol feature has been
1821 + successfully negotiated, this message can be submitted by the front-end
1822 + to gather the VIRTIO Shared Memory Region configuration. The back-end will
1823 + respond with the number of VIRTIO Shared Memory Regions it requires, and
1824 + each shared memory region size in an array. The shared memory IDs are
1825 + represented by the array index. The information returned shall comply
1826 + with the following rules:
1827 +
1828 + * The shared information will remain valid and unchanged for the entire
1829 + lifetime of the connection.
1830 +
1831 + * The Shared Memory Region size must be a multiple of the page size
1832 + supported by mmap(2).
1833 +
1834 + * The size may be 0 if the region is unused.
1835 +
1836 Back-end message types
1837 ----------------------
1838