aboutsummaryrefslogtreecommitdiff
path: root/samples/client.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-15send file descriptors for sparse areas in get region info (#201)Thanos Makatos1-17/+38
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-14return region capabilities a la VFIO (#187)Thanos Makatos1-44/+59
This patch returns region capabilities the same way VFIO does: if argsz is not large enough then it returns only region info and sets argsz to what it should be in order to fit the capabilities, the client then retries with a large enough argsz. The protocol specification has been updated as well. Plus unit tests. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02use log level defines from syslogThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27rename to libvfio-user (#128)John Levon1-78/+79
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)swapnili1-4/+4
* PCI regions idx enum renamed to start with LM_PCI Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-24Api refactoring (#115)swapnili1-5/+5
API refactoring
2020-11-24clean up headersJohn Levon1-3/+3
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 Levon1-19/+24
2020-11-20don't expose migration as regionThanos Makatos1-30/+40
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-20drop pci_info from lm_ctxThanos Makatos1-0/+12
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-19refactor socket code into lib/tran_sock.[ch] (#97)John Levon1-2/+21
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-18implement migration resuming on destination serverThanos Makatos1-61/+219
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-18client/server sample: trigger IRQ based on alarmThanos Makatos1-68/+67
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-17Fix compiler errors for non-dbg buildSwapnil Ingle1-2/+3
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-12Fix issues pointed by CFLAGS "-Wall -Werror -Wextra"Swapnil Ingle1-20/+20
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-05experimental support for running the device state and copy iteration protocolThanos Makatos1-30/+198
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-10-29support for live migration region and dirty page loggingThanos Makatos1-59/+193
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-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>
2020-10-07client, server changes for VFIO_USER_DEVICE_RESETSwapnil Ingle1-0/+15
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-10-07client, server changes for lm_irq_message()Swapnil Ingle1-2/+26
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-10-05Add test for VFIO_USER_DMA_READ and VFIO_USER_DMA_WRITESwapnil Ingle1-14/+140
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-30client: better output messagesSwapnil Ingle1-3/+3
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-29client: reviewed get_device_region_info()Swapnil Ingle1-20/+13
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-29Implementation of VFIO_USER_DEVICE_GET_REGION_INFOSwapnil Ingle1-2/+73
WIP: test sparse capability and add sample test for it Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-29Keep client dev_info for further useSwapnil Ingle1-9/+8
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-29implement VFIO_USER_REGION_READ/VFIO_USER_REGION_WRITEThanos Makatos1-5/+66
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-29fix typoThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-29remove unnecessary pause from sample clientThanos Makatos1-2/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-29remove unused function map_dma from sample clientThanos Makatos1-6/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-29introduce convinience function send_recv_vfio_user_msgThanos Makatos1-53/+19
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-28implement VFIO_USER_DEVICE_SET_IRQSThanos Makatos1-25/+87
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-28Fix handling of VFIO_USER_DEVICE_GET_INFOSwapnil Ingle1-3/+5
vfio_device_info.argsz is set by the client and server is expected to use/validate it. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-25implement VFIO_USER_DEVICE_GET_IRQ_INFOThanos Makatos1-17/+41
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-25implement VFIO_USER_DMA_UNMAPThanos Makatos1-7/+26
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-24implement VFIO_USER_DMA_MAPThanos Makatos1-41/+64
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-23Initial implementation of VFIO_USER_DEVICE_GET_INFOSwapnil Ingle1-0/+47
Initial client and server implementation of VFIO_USER_DEVICE_GET_INFO. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-09-23start handling MAP_DMA, FDs not yet receivedThanos Makatos1-33/+34
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-23refactor send/recv of message plus fixesThanos Makatos1-43/+75
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-09-23refactor initializing socket and setting version into separate functionsThanos Makatos1-15/+37
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>