mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
vfio: add read/write to device IO ops vector
Now we have the region info cache, add ->region_read/write device I/O operations instead of explicit pread()/pwrite() system calls. Signed-off-by: John Levon <john.levon@nutanix.com> Link: https://lore.kernel.org/qemu-devel/20250507152020.1254632-13-john.levon@nutanix.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
95cdb02451
commit
776066ac90
4 changed files with 77 additions and 20 deletions
|
@ -188,6 +188,24 @@ struct VFIODeviceIOOps {
|
|||
* Configure IRQs as defined by @irqs.
|
||||
*/
|
||||
int (*set_irqs)(VFIODevice *vdev, struct vfio_irq_set *irqs);
|
||||
|
||||
/**
|
||||
* @region_read
|
||||
*
|
||||
* Read @size bytes from the region @nr at offset @off into the buffer
|
||||
* @data.
|
||||
*/
|
||||
int (*region_read)(VFIODevice *vdev, uint8_t nr, off_t off, uint32_t size,
|
||||
void *data);
|
||||
|
||||
/**
|
||||
* @region_write
|
||||
*
|
||||
* Write @size bytes to the region @nr at offset @off from the buffer
|
||||
* @data.
|
||||
*/
|
||||
int (*region_write)(VFIODevice *vdev, uint8_t nr, off_t off, uint32_t size,
|
||||
void *data);
|
||||
};
|
||||
|
||||
void vfio_device_prepare(VFIODevice *vbasedev, VFIOContainerBase *bcontainer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue