virtio-devices: mem: Allow for an initial size

This commit gives the possibility to create a virtio-mem device with
some memory already plugged into it. This is preliminary work to be
able to reboot a VM with the virtio-mem region being already resized.

Signed-off-by: Hui Zhu <teawater@antfin.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Hui Zhu
2020-08-10 18:22:55 +08:00
committed by Sebastien Boeuf
parent 8b5202aa5a
commit 33a1e37c35
2 changed files with 51 additions and 31 deletions

View File

@@ -2451,6 +2451,7 @@ impl DeviceManager {
.map_err(DeviceManagerError::TryCloneVirtioMemResize)?,
self.seccomp_action.clone(),
node_id,
0,
)
.map_err(DeviceManagerError::CreateVirtioMem)?,
));