aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-08build a static libvfio-user (#173)John Levon2-15/+19
Note that we intentionally don't install it: this is really for use when building as a sub-module. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07lspci: fix build with gcc 4 (#172)John Levon1-4/+4
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07replace travis with github actions (#171)John Levon2-7/+19
Travis is closing down their free tier; stop using it. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-07add lspci sampleThanos Makatos3-6/+120
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07rename prepare_ctx into vfio_realize_ctx and make it publicThanos Makatos2-12/+24
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07assorted PCI capabilities improvementsThanos Makatos2-3/+14
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07don't ignore PCI type set by userThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07convert vfu_ctx->read to boolThanos Makatos2-4/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07don't return invalid errnoThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07group PCI membersThanos Makatos2-24/+28
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07Remove obsolete comment (#167)swapnili1-2/+0
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2020-12-07setup an IRQ for the gpio sample server (#169)John Levon1-0/+5
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-07Remove sock_flags from struct vfu_ctx (#163)swapnili2-7/+5
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2020-12-07move vfu_cap_t closer to where it's usedThanos Makatos1-8/+8
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-04implement VFIO_USER_FLAG_NO_REPLY (#157)John Levon1-6/+14
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-03document mailing listThanos Makatos1-0/+8
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02don't spam logs when closing unexpected file descriptorThanos Makatos1-7/+3
A malicious client might take advantage of this behavior. Also, don't differentiate between failure and extraneous FD cases. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02add pre-push target (#150)John Levon2-6/+7
Add a target that builds in debug and release mode and runs the tests in each. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02replace struct vfu_mmap_area with struct iovecThanos Makatos4-17/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02emit warning when receiving extraneous file descriptorsThanos Makatos1-1/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02rename VFU_REG_FLAG_* (#145)John Levon7-18/+17
We renamed other code to be "REGION" instead of "REG" so it's less ambiguous. Do the same for VFU_REG_FLAG_*. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-02use log level defines from syslogThanos Makatos15-193/+189
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02Merge pull request #144 from tmakatos/issues/106Thanos7-30/+92
introduce device and PCI types
2020-12-02introduce PCI typesThanos Makatos6-18/+69
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02introduce device typeThanos Makatos6-5/+23
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02resue PCI config space size from system headerThanos Makatos1-7/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01Check for truncated response in get_request_sock() (#142)swapnili1-0/+4
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2020-12-01drop unnecessary restore_fdThanos Makatos3-17/+13
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01log when closing unused file descriptorThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01remove obsolete commentThanos Makatos1-2/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01make consume_fd to return the fd it consumesThanos Makatos4-15/+33
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01introduce consume_fd to simplify tracking of passed file descriptorsThanos Makatos4-47/+45
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01also closed unused file descriptors on successThanos Makatos1-3/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01remove obsolete FIXMEThanos Makatos1-1/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01don't leak passed file descriptors on failureThanos Makatos8-44/+316
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01include entire license text in READMEThanos Makatos1-2/+27
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01fix copyrightThanos Makatos1-27/+31
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-30Misc cleanup (#138)swapnili6-44/+40
* Rename vfu_ctx_destroy() to vfu_destroy_ctx() * Remove unused function copy_sparse_mmap_area() * Coding style fixes Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2020-11-30add copyright notice in READMEThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-30add license notice in READMEThanos Makatos1-0/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-30Update API's to accept sparse mmap areas as array and its count (#134)swapnili5-40/+37
* Pass region mmap areas as array * Pass migration sparse mmap areas as array * Move struct vfu_sparse_mmap_areas to lib/priv.h Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27refactor process_requestThanos Makatos1-61/+83
This patch refactors process_request to simplify code in the following way: 1. Failures before exec_command do not require a response to be sent and all passed descriptors must be released. 2. Failures after exec_command require a response. File descriptors must be released depending on how many file descriptors where successfully consumed. This refactoring makes it simpler to implement releasing file descriptors in the 2nd case. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27rename to libvfio-user (#128)John Levon37-1554/+1570
The muser name no longer reflects the implementation, and will just serve to confuse. Bite the bullet now, and rename ourselves to reflect the actual implementation. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-27fix test build (#132)John Levon1-7/+13
Some cmake versions don't handle backslashes well; use more specific facilities to add the compile and link flags. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27add unit tests for DMA regions without file descriptorThanos Makatos8-23/+354
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27allow DMA regions without file descriptorThanos Makatos2-52/+58
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27add assertThanos Makatos1-0/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-25add "make test"; run it in pre-commit (#127)John Levon4-2/+9
Also rename test.c to reflect it should cover unit tests. Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Signed-off-by: John Levon <john.levon@nutanix.com>
2020-11-25handle_dma_map_or_unmap(): correct fd handling (#118)John Levon1-14/+24
We shouldn't consume fd's for regions lacking VFIO_USER_F_DMA_REGION_MAPPABLE. In addition, we'll ignore such a region (this is a temporary hack). Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Signed-off-by: John Levon <john.levon@nutanix.com>
2020-11-25PCI regions idx enum renamed to start with LM_PCI (#125)swapnili7-32/+32
* PCI regions idx enum renamed to start with LM_PCI Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>