mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: drop "kvm" from memory slot code
The code is purely for maintaining an internal counter. It is not really tied to KVM. No functional change. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -2396,10 +2396,7 @@ impl DeviceManager {
|
|||||||
|
|
||||||
vfio_pci_device
|
vfio_pci_device
|
||||||
.map_mmio_regions(&self.address_manager.vm, || {
|
.map_mmio_regions(&self.address_manager.vm, || {
|
||||||
self.memory_manager
|
self.memory_manager.lock().unwrap().allocate_memory_slot()
|
||||||
.lock()
|
|
||||||
.unwrap()
|
|
||||||
.allocate_kvm_memory_slot()
|
|
||||||
})
|
})
|
||||||
.map_err(DeviceManagerError::VfioMapRegion)?;
|
.map_err(DeviceManagerError::VfioMapRegion)?;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ struct HotPlugState {
|
|||||||
|
|
||||||
pub struct MemoryManager {
|
pub struct MemoryManager {
|
||||||
guest_memory: GuestMemoryAtomic<GuestMemoryMmap>,
|
guest_memory: GuestMemoryAtomic<GuestMemoryMmap>,
|
||||||
next_kvm_memory_slot: u32,
|
next_memory_slot: u32,
|
||||||
start_of_device_area: GuestAddress,
|
start_of_device_area: GuestAddress,
|
||||||
end_of_device_area: GuestAddress,
|
end_of_device_area: GuestAddress,
|
||||||
pub vm: Arc<dyn hypervisor::Vm>,
|
pub vm: Arc<dyn hypervisor::Vm>,
|
||||||
@@ -320,7 +320,7 @@ impl MemoryManager {
|
|||||||
|
|
||||||
let memory_manager = Arc::new(Mutex::new(MemoryManager {
|
let memory_manager = Arc::new(Mutex::new(MemoryManager {
|
||||||
guest_memory: guest_memory.clone(),
|
guest_memory: guest_memory.clone(),
|
||||||
next_kvm_memory_slot: 0,
|
next_memory_slot: 0,
|
||||||
start_of_device_area,
|
start_of_device_area,
|
||||||
end_of_device_area,
|
end_of_device_area,
|
||||||
vm,
|
vm,
|
||||||
@@ -661,9 +661,9 @@ impl MemoryManager {
|
|||||||
self.end_of_device_area
|
self.end_of_device_area
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn allocate_kvm_memory_slot(&mut self) -> u32 {
|
pub fn allocate_memory_slot(&mut self) -> u32 {
|
||||||
let slot_id = self.next_kvm_memory_slot;
|
let slot_id = self.next_memory_slot;
|
||||||
self.next_kvm_memory_slot += 1;
|
self.next_memory_slot += 1;
|
||||||
slot_id
|
slot_id
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +675,7 @@ impl MemoryManager {
|
|||||||
mergeable: bool,
|
mergeable: bool,
|
||||||
readonly: bool,
|
readonly: bool,
|
||||||
) -> Result<u32, Error> {
|
) -> Result<u32, Error> {
|
||||||
let slot = self.allocate_kvm_memory_slot();
|
let slot = self.allocate_memory_slot();
|
||||||
let mem_region = hypervisor::MemoryRegion {
|
let mem_region = hypervisor::MemoryRegion {
|
||||||
slot,
|
slot,
|
||||||
guest_phys_addr,
|
guest_phys_addr,
|
||||||
|
|||||||
Reference in New Issue
Block a user