diff --git a/devices/src/pci/vfio_pci.rs b/devices/src/pci/vfio_pci.rs index 915969acc3..29e26bf8b1 100644 --- a/devices/src/pci/vfio_pci.rs +++ b/devices/src/pci/vfio_pci.rs @@ -782,6 +782,7 @@ impl VfioPciDevice { size: mmap_size as usize, offset, gpa: guest_map_start, + read_only: false, }) .is_err() { diff --git a/devices/src/platform/vfio_platform.rs b/devices/src/platform/vfio_platform.rs index 37673d03c2..0f7a784fcd 100644 --- a/devices/src/platform/vfio_platform.rs +++ b/devices/src/platform/vfio_platform.rs @@ -173,6 +173,7 @@ impl VfioPlatformDevice { size: mmap_size.try_into().unwrap(), offset, gpa: guest_map_start, + read_only: false, }) .is_err() { diff --git a/vm_control/src/lib.rs b/vm_control/src/lib.rs index 98b7d85f14..eec3221f43 100644 --- a/vm_control/src/lib.rs +++ b/vm_control/src/lib.rs @@ -288,6 +288,7 @@ pub enum VmMemoryRequest { size: usize, offset: u64, gpa: u64, + read_only: bool, }, } @@ -439,6 +440,7 @@ impl VmMemoryRequest { size, offset, gpa, + read_only, } => { let mmap = match MemoryMappingBuilder::new(size) .from_descriptor(descriptor) @@ -448,7 +450,7 @@ impl VmMemoryRequest { Ok(v) => v, Err(_e) => return VmMemoryResponse::Err(SysError::new(EINVAL)), }; - match vm.add_memory_region(GuestAddress(gpa), Box::new(mmap), false, false) { + match vm.add_memory_region(GuestAddress(gpa), Box::new(mmap), read_only, false) { Ok(slot) => VmMemoryResponse::RegisterMemory { pfn: 0, slot }, Err(e) => VmMemoryResponse::Err(e), }