aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-16add github settings configuration (#207)John Levon1-0/+113
Using https://github.com/apps/settings, we can directly configure the repository configuration by modifying and pushing .github/settings.yml Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-16don't treat non-zero return value of dma_controller_add_region as failure (#206)Thanos Makatos2-1/+29
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-15send file descriptors for sparse areas in get region info (#201)Thanos Makatos10-145/+340
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-15add CentOS 7 build to github pull_request workflow (#194)John Levon3-3/+17
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-15clean up the API header file (#197)John Levon2-242/+240
This is almost entirely re-ordering: first the basic lifecycle things, then vfu_setup_*() group, then handlers and helpers, and finally PCI handling. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-15remove vfu_get_pci_non_std_config_space() (#195)John Levon3-33/+11
Remove this API as well as vfu_pci_non_std_config_space_t. It's at best confusing to try to represent this area as if it's not just a normal part of the overall config space, and we don't really want an additional API for the extended space past either. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-14return region capabilities a la VFIO (#187)Thanos Makatos5-67/+160
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-14unit-tests: fix GCC4 build (#193)John Levon1-1/+1
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-14add unit test for device get info (#192)Thanos Makatos3-1/+19
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-14don't return memory allocated on the stackThanos Makatos1-16/+30
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-14don't leak memory in server sampleThanos Makatos1-0/+1
Make valgrind happy. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-11add support PCI vendor-specific capabilityThanos Makatos6-20/+147
The PCI vendor-specific capability is blindly read/written by the library. It is possible that the user might want to intercept accesses to it, in which case we'll have to add callback. The best way to do this to introduce a new function that configures callbacks for the PCI capabilities, e.g. typedef ssize_t (vfu_cap_access_t) (void *pvt, uint8_t id, char *buf, size_t count, loff_t offset, bool is_write); vfu_pci_cap_set_cb(vfu_ctx-T *vfu_ctx, uint8_t cap_id, vfu_cap_access_t *cb); This way the existing API won't have to change. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-11minor comment fixesThanos Makatos2-4/+11
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-11remove unused typedefThanos Makatos1-18/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-11allow over-riding "cmake" (#184)John Levon1-1/+3
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-10add docs on running the gpio server back to README (#181)John Levon1-3/+36
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-10Drop vfu_ctx_drive() and use vfu_ctx_poll() (#178)swapnili8-44/+68
* Drop vfu_ctx_drive() and use vfu_run_ctx() Renamed vfu_ctx_poll() to vfu_run_ctx(). Updated vfu_run_ctx() to also handle blocking ctx. Instead of having separate functions for blocking and non-blocking ctx, better to have one. This way user can call same set of functions for both cases. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-09unit tests: fix gcc4 build (#182)John Levon1-1/+1
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-08Better vfu_attach_ctx() UT (#176)swapnili1-3/+12
Better vfu_attach_ctx() UT Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-08Misc fixes for vfu_ctx_try_attach() and vfu_realize_ctx() (#175)swapnili7-54/+86
Misc changes for vfu_ctx_try_attach() * Rename to vfu_attach_ctx() * Removed call to vfu_realize_ctx(), should be called separately * Now vfu_attach_ctx() must also be called for blocking ctx. Misc changes for vfu_realize_ctx() * Made calling vfu_realize_ctx() mandatory * vfu_ctx_drive() and vfu_poll_ctx() returns EINVAL if the device is not realized. * Renamed vfu_ctx->ready to vfu_ctx->realized Added unit test for vfu_attach_ctx() and vfu_realize_ctx() Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-08add shared library versioning (#174)John Levon1-4/+18
Add basic "soname" versioning (but don't yet start using it meaningfully). Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
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>