mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add hotplugged_size to VirtioMemZone
Adding a new field to VirtioMemZone structure, as it lets us associate with a particular virtio-mem region the amount of memory that should be plugged in at boot. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -2449,7 +2449,7 @@ impl DeviceManager {
|
|||||||
.map_err(DeviceManagerError::TryCloneVirtioMemResize)?,
|
.map_err(DeviceManagerError::TryCloneVirtioMemResize)?,
|
||||||
self.seccomp_action.clone(),
|
self.seccomp_action.clone(),
|
||||||
node_id,
|
node_id,
|
||||||
0,
|
virtio_mem_zone.hotplugged_size(),
|
||||||
)
|
)
|
||||||
.map_err(DeviceManagerError::CreateVirtioMem)?,
|
.map_err(DeviceManagerError::CreateVirtioMem)?,
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ struct HotPlugState {
|
|||||||
pub struct VirtioMemZone {
|
pub struct VirtioMemZone {
|
||||||
region: Arc<GuestRegionMmap>,
|
region: Arc<GuestRegionMmap>,
|
||||||
resize_handler: virtio_devices::Resize,
|
resize_handler: virtio_devices::Resize,
|
||||||
|
hotplugged_size: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VirtioMemZone {
|
impl VirtioMemZone {
|
||||||
@@ -76,6 +77,9 @@ impl VirtioMemZone {
|
|||||||
pub fn resize_handler(&self) -> &virtio_devices::Resize {
|
pub fn resize_handler(&self) -> &virtio_devices::Resize {
|
||||||
&self.resize_handler
|
&self.resize_handler
|
||||||
}
|
}
|
||||||
|
pub fn hotplugged_size(&self) -> u64 {
|
||||||
|
self.hotplugged_size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
@@ -612,6 +616,7 @@ impl MemoryManager {
|
|||||||
region,
|
region,
|
||||||
resize_handler: virtio_devices::Resize::new()
|
resize_handler: virtio_devices::Resize::new()
|
||||||
.map_err(Error::EventFdFail)?,
|
.map_err(Error::EventFdFail)?,
|
||||||
|
hotplugged_size: zone.hotplugged_size.unwrap_or(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
start_of_device_area = start_addr.unchecked_add(hotplug_size);
|
start_of_device_area = start_addr.unchecked_add(hotplug_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user