vmm: Add support for virtio-mem

This commit adds new option hotplug_method to memory config.
It can set the hotplug method to "acpi" or "virtio-mem".

Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
Hui Zhu
2020-03-04 10:16:07 +08:00
committed by Sebastien Boeuf
parent 51d102c708
commit e6b934a56a
4 changed files with 133 additions and 15 deletions

View File

@@ -169,6 +169,9 @@ pub enum Error {
/// No PCI support
NoPciSupport,
/// Eventfd write error
EventfdError(std::io::Error),
}
pub type Result<T> = result::Result<T, Error>;
@@ -337,6 +340,7 @@ impl Vm {
allocator.clone(),
fd.clone(),
memory_config.size,
memory_config.hotplug_method,
memory_config.hotplug_size,
&memory_config.file,
memory_config.mergeable,