aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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>
2020-11-25Split log setup from lm_create_ctx() to lm_setup_log() (#126)swapnili5-12/+42
* Split log setup from lm_create_ctx() to lm_setup_log() Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-25introduce cmocka unit test framework and first unit testThanos Makatos6-2/+100
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-25ignore DMA map/unmap if device isn't using DMA controllerThanos Makatos1-4/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-24fix compile with gcc 4.8.5John Levon1-4/+4
2020-11-24fix a comment referencing the kernel moduleJohn Levon1-1/+1
2020-11-24Api refactoring (#115)swapnili14-530/+662
API refactoring
2020-11-24clean up headersJohn Levon22-118/+237
Introduce include/ dir for public headers, and clean up include guards etc.
2020-11-24get_request_sock: set nr_fds always (#116)John Levon1-0/+2
2020-11-24refactor sock send/recv functions (#114)John Levon6-141/+217
Use shorter, more readable, function names, add re-jig the wrappers such that the most common operations are shortest.
2020-11-24parse VFIO_USER_VERSION JSON stanzaJohn Levon11-86/+239
2020-11-23move IRQ into separate fileThanos Makatos4-390/+476
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23silence false positive Coverity warningThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't ignore return value from functionThanos Makatos1-2/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't attempt to close invalid file desriptorThanos Makatos1-1/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't dereference NULL pointerThanos Makatos1-1/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23fix printf argsThanos Makatos5-29/+31
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't pass -1 to fstatThanos Makatos1-0/+10
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't omit argument from printfThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23silence false positive coverity about out-of-bounds writeThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-23don't leak fd on failureThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20Merge pull request #109 from tmakatos/live-migrationswapnili7-123/+157
don't expose live migration as device region
2020-11-20don't expose migration as regionThanos Makatos7-111/+145
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20don't attach before initializing the DMA controllerThanos Makatos1-12/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20drop pci_info from lm_ctxThanos Makatos4-34/+44
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20document how to create release buildThanos Makatos1-0/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20don't assume debug build for running server sampleThanos Makatos1-5/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20silence false-positive -Wmaybe-uninitialized warning in GCC 7Thanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20move migration into separate fileThanos Makatos7-420/+550
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-19enable assert() in release builds (#98)John Levon9-18/+35