vfio: mark posted writes in region write callbacks

For vfio-user, the region write implementation needs to know if the
write is posted; add the necessary plumbing to support this.

Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250607001056.335310-5-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
John Levon 2025-06-06 17:10:36 -07:00 committed by Cédric Le Goater
parent 59adfc6f18
commit a574b06144
5 changed files with 11 additions and 5 deletions

View file

@ -205,10 +205,10 @@ struct VFIODeviceIOOps {
* @region_write
*
* Write @size bytes to the region @nr at offset @off from the buffer
* @data.
* @data; if @post, the write is posted.
*/
int (*region_write)(VFIODevice *vdev, uint8_t nr, off_t off, uint32_t size,
void *data);
void *data, bool post);
};
void vfio_device_prepare(VFIODevice *vbasedev, VFIOContainerBase *bcontainer,

View file

@ -29,6 +29,7 @@ typedef struct VFIORegion {
uint32_t nr_mmaps;
VFIOMmap *mmaps;
uint8_t nr; /* cache the region number for debug */
bool post_wr; /* writes can be posted */
} VFIORegion;