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 <xiong.y.zhang@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1918486
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Xiong Zhang 2019-09-04 17:55:58 +08:00 committed by Commit Bot
parent 1de388ae02
commit 40a721b434

View file

@ -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 {