From 40a721b434f8bc59aac0010d5612ef3ac39f20c8 Mon Sep 17 00:00:00 2001 From: Xiong Zhang Date: Wed, 4 Sep 2019 17:55:58 +0800 Subject: [PATCH] vfio: Don't exit at get_region_info failure At vfio device initialization, it will probe all the defined regions, most device don't have vga region, then when crosvm probe vga region info, kernel vfio will return -EINVAL. So when error happens, it should continue getting the next region info, instead of exit. BUG=None TEST=passthrough non graphic device into guest Change-Id: If4d2f723df45f58ccd733e03c854cdcef3530bdb Signed-off-by: Xiong Zhang Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1918486 Reviewed-by: Daniel Verkamp Tested-by: kokoro --- devices/src/vfio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/src/vfio.rs b/devices/src/vfio.rs index 501a0bb3e7..d376cf9170 100644 --- a/devices/src/vfio.rs +++ b/devices/src/vfio.rs @@ -485,7 +485,7 @@ impl VfioDevice { // and we verify the return value. ret = unsafe { ioctl_with_mut_ref(dev, VFIO_DEVICE_GET_REGION_INFO(), &mut reg_info) }; if ret < 0 { - return Err(VfioError::VfioDeviceGetRegionInfo(get_error())); + continue; } let region = VfioRegion {