aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_device_get_region_info.py
AgeCommit message (Collapse)AuthorFilesLines
2021-11-30introduce device quiesce callback (#609)Thanos Makatos1-4/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Leon <john.levon@nutanix.com>
2021-11-12don't assert in dev_get_caps() (#621)John Levon1-0/+30
As clients control ->client_max_fds, we should return an error, not assert, if we can't represent a region's mmap_areas. Found via AFL++. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-11-11Fix reply of VFIO_USER_DEVICE_GET_REGION_INFO (#619)Swapnil Ingle1-2/+6
* Fix reply of VFIO_USER_DEVICE_GET_REGION_INFO Set VFIO_REGION_INFO_FLAG_CAPS flag only if caps are part of the reply. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-10-22run python code through flake8 (#613)John Levon1-4/+12
Aside from general style goodness, this found a couple of accidental re-definitions, so it's worth taking the pain now. Also, only run rstlint as part of pre-push. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-06-10python tests: add msg() utility function (#562)John Levon1-28/+10
Most tests need to send a request, process it, then retrieve the reply. Add a utility function to avoid lots of tedious boilerplate. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-25cleanup some python tests (#482)John Levon1-27/+38
As suggested by Thanos, replace hard-coded struct.pack() with ctypes.Structure objects so it's much clearer what the data being constructed is. Replace some hard-coded unpacking with code based on ctypes::from_buffer_copy(), but in a form that allows us to "pop" a structure from a longer buffer. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-25more spec updates (#491)John Levon1-1/+1
update spec to v0.9.1 Changes include: - reply message includes the command number - split out message definitions into request/reply sections, and skip the repeated standard header definitions - lots of markup fixes - re-organization for clarity - further documentation of argsz - remove VFIO_USER_VM_INTERRUPT until we have a working implementation - dirty page tracking is optional - fix implementations to match the spec Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-24fix region offset handling (#485)John Levon1-5/+7
The specification states that the region offset given in the region info should be used as the "offset" when mmap()ing the region from the client side. However, the library instead implemented a fixed offset scheme similar to that of vfio - and no clients actually set up the file like that. Instead, let servers define their own offsets, and pass them through to clients as is. It's up to the server to decide how its backing file or files is organized. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-20python tests: add VFIO_USER_DEVICE_GET_REGION_INFO (#471)John Levon1-0/+222
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>