From 56842967566dcf4b89514949a6e88ba89eeaf268 Mon Sep 17 00:00:00 2001 From: Swapnil Ingle Date: Thu, 11 Nov 2021 19:25:34 +0100 Subject: Fix reply of VFIO_USER_DEVICE_GET_REGION_INFO (#619) * 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 Reviewed-by: John Levon --- test/py/test_device_get_region_info.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/py/test_device_get_region_info.py b/test/py/test_device_get_region_info.py index f7e63d2..cea3e98 100644 --- a/test/py/test_device_get_region_info.py +++ b/test/py/test_device_get_region_info.py @@ -134,10 +134,14 @@ def test_device_get_region_info_small_argsz_caps(): info, _ = vfio_region_info.pop_from_buffer(result) assert info.argsz == 80 + + ''' + There are capabilites but we do not expect VFIO_REGION_INFO_FLAG_CAPS + to be set because they do not fit in reply as argsz is small + ''' assert info.flags == (VFIO_REGION_INFO_FLAG_READ | VFIO_REGION_INFO_FLAG_WRITE | - VFIO_REGION_INFO_FLAG_MMAP | - VFIO_REGION_INFO_FLAG_CAPS) + VFIO_REGION_INFO_FLAG_MMAP) assert info.index == VFU_PCI_DEV_BAR2_REGION_IDX assert info.cap_offset == 0 assert info.size == 0x8000 -- cgit v1.1