fix(vfio): clear the multi-function device bit

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
This commit is contained in:
Changyuan Lyu 2024-11-05 22:50:11 -08:00 committed by Lencerf
parent a64c445e4c
commit 022d4535b2

View file

@ -427,6 +427,7 @@ where
cdev.dev.fd().read_at(&mut buf, region_config.offset)?;
let (mut dev_header, _) = DeviceHeader::read_from_prefix(&buf).unwrap();
dev_header.common.header_type &= !(1 << 7);
if dev_header.common.header_type != HeaderType::Device as u8 {
return error::NotSupportedHeader {
ty: dev_header.common.header_type,