mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 15:42:09 -06:00
block: Introduce buf register API
Allow block driver to map and unmap a buffer for later I/O, as a performance hint. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180116060901.17413-5-famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
parent
bdd6a90a9e
commit
23d0ba9319
5 changed files with 56 additions and 1 deletions
|
@ -446,6 +446,15 @@ struct BlockDriver {
|
|||
const char *name,
|
||||
Error **errp);
|
||||
|
||||
/**
|
||||
* Register/unregister a buffer for I/O. For example, when the driver is
|
||||
* interested to know the memory areas that will later be used in iovs, so
|
||||
* that it can do IOMMU mapping with VFIO etc., in order to get better
|
||||
* performance. In the case of VFIO drivers, this callback is used to do
|
||||
* DMA mapping for hot buffers.
|
||||
*/
|
||||
void (*bdrv_register_buf)(BlockDriverState *bs, void *host, size_t size);
|
||||
void (*bdrv_unregister_buf)(BlockDriverState *bs, void *host);
|
||||
QLIST_ENTRY(BlockDriver) list;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue