diff options
author | Swapnil Ingle <swapnil.ingle@nutanix.com> | 2021-08-27 13:18:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 13:18:53 +0200 |
commit | 080e664ed5e79dcf5ae5a36521cab0ddb7ebc5f0 (patch) | |
tree | 5d920a8a71aa57f088aba9a6f881c71121866f69 /samples/client.c | |
parent | 2ed612697e8fde14e9995cc1ac4dd5143ae8e0b7 (diff) | |
download | libvfio-user-080e664ed5e79dcf5ae5a36521cab0ddb7ebc5f0.zip libvfio-user-080e664ed5e79dcf5ae5a36521cab0ddb7ebc5f0.tar.gz libvfio-user-080e664ed5e79dcf5ae5a36521cab0ddb7ebc5f0.tar.bz2 |
Add support for VFIO_DMA_UNMAP_FLAG_ALL flag (#600)
* Add support for VFIO_DMA_UNMAP_FLAG_ALL flag
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'samples/client.c')
-rw-r--r-- | samples/client.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/samples/client.c b/samples/client.c index ef3202c..80a84d4 100644 --- a/samples/client.c +++ b/samples/client.c @@ -1302,6 +1302,19 @@ int main(int argc, char *argv[]) handle_dma_io(sock, dma_regions + server_max_fds, nr_dma_regions - server_max_fds, dma_region_fds + server_max_fds); + + struct vfio_user_dma_unmap r = { + .argsz = sizeof(r), + .addr = 0, + .size = 0, + .flags = VFIO_DMA_UNMAP_FLAG_ALL + }; + ret = tran_sock_msg(sock, 8, VFIO_USER_DMA_UNMAP, &r, sizeof(r), + NULL, &r, sizeof(r)); + if (ret < 0) { + err(EXIT_FAILURE, "failed to unmap all DMA regions"); + } + return 0; } |