aboutsummaryrefslogtreecommitdiff
path: root/samples
AgeCommit message (Collapse)AuthorFilesLines
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-07add lspci sampleThanos Makatos2-0/+81
Signed-off-by: Thanos Makatos <thanos.makatos@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-02replace struct vfu_mmap_area with struct iovecThanos Makatos1-3/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02rename VFU_REG_FLAG_* (#145)John Levon2-3/+3
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 Makatos4-13/+13
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02introduce PCI typesThanos Makatos3-2/+11
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02introduce device typeThanos Makatos3-3/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-30Misc cleanup (#138)swapnili3-3/+3
* 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-30Update API's to accept sparse mmap areas as array and its count (#134)swapnili2-17/+9
* 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-27rename to libvfio-user (#128)John Levon6-177/+178
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-25PCI regions idx enum renamed to start with LM_PCI (#125)swapnili3-7/+7
* 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)swapnili3-5/+18
* Split log setup from lm_create_ctx() to lm_setup_log() Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-24fix compile with gcc 4.8.5John Levon1-4/+4
2020-11-24Api refactoring (#115)swapnili4-73/+89
API refactoring
2020-11-24clean up headersJohn Levon4-13/+13
Introduce include/ dir for public headers, and clean up include guards etc.
2020-11-24refactor sock send/recv functions (#114)John Levon1-69/+85
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 Levon2-19/+25
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-23fix printf argsThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20don't expose migration as regionThanos Makatos2-47/+51
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20drop pci_info from lm_ctxThanos Makatos2-0/+15
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-20move migration into separate fileThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-19enable assert() in release builds (#98)John Levon2-9/+18
2020-11-19refactor socket code into lib/tran_sock.[ch] (#97)John Levon5-6/+29
2020-11-18implement new negotiation implementationJohn Levon1-24/+94
Refactor for a partial re-implementation of initial vfio-user negotiation. Still needs to do the JSON parsing - in the meantime, hard-code the max_fds parameters we expect.
2020-11-18samples/server.c: add _GNU_SOURCE for aligned_alloc()John Levon1-0/+1
2020-11-18implement migration resuming on destination serverThanos Makatos2-78/+328
This patch implements resuming on the destination server. We also demonstrate how to do this in the client/server sample. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18samples/server: replace fprintf(stdout, ...) with printf for simplicityThanos Makatos1-7/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18samples/client: use err/errx for simplicityThanos Makatos1-205/+119
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18samples/server: use err/errx for simplicityThanos Makatos1-29/+17
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18client/server sample: trigger IRQ based on alarmThanos Makatos2-74/+80
This avoid having to manually send USR1 to the server. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18remove commented out headerThanos Makatos1-1/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18don't assert on error, instead respond with the relevant bit setThanos Makatos1-0/+8
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-18small cleanups post-muser.ko removalJohn Levon3-12/+8
2020-11-17remove test_dma_map.c,test_mmap.c and test_read.cSwapnil Ingle4-682/+0
Those files were intended for kmod. No use for vfio-user. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-17Fix compiler errors for non-dbg buildSwapnil Ingle3-15/+23
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-16validate argszThanos Makatos1-0/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-16eliminate duplicate recv(2) codeThanos Makatos1-0/+6
Instead of having each command handler do its own recv(2) to receive the command, we do this once for all commands. This reduces the code a bit. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-13samples/server: don't complain for failure when device reaches stopped ↵Thanos Makatos1-1/+1
migration state Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-12Fix issues pointed by CFLAGS "-Wall -Werror -Wextra"Swapnil Ingle6-49/+54
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-11Merge branch 'vfio-user'Thanos Makatos5-6/+1471
2020-11-05experimental support for running the device state and copy iteration protocolThanos Makatos2-33/+271
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-29support for live migration region and dirty page loggingThanos Makatos2-61/+214
This patch adds support for the live migration region and dirty page logging following VFIO. Live migration is NOT yet functional as handling accesses to the migration region is not yet implemented. Currenty the live migration region is fixed at index 9 simply for simplifying the implementation. Dirty page logging is simplified by requiring IOVA ranges to match exactly the entire IOVA range. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-26samples/server: don't print invalid errno when failing to realize device ↵Thanos Makatos1-1/+2
emulation Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-22samples/client: move VFIO_USER_REGION_READ/VFIO_USER_REGION_WRITE earlierThanos Makatos1-12/+12
It's better to have this test earlier in the code, before we have to manually trigger an IRQ, so that we can catch developement errors more easily. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-22samples/client: also receive region_access response for region writeThanos Makatos1-3/+9
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-22include region header when replying to ↵Thanos Makatos1-1/+3
VFIO_USER_REGION_READ/VFIO_USER_REGION_WRITE Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>