[RFC PATCH v2 01/10] host/start-vm: use MAP_SHARED memory for VMs

Alyssa Ross
2022-09-30T21:35:58Z

From: Alyssa Ross <hi@alyssa.is>

This is required for any use of vhost-user. Since any VM might have a
vhost-user device hotplugged, this needs to be on from the start for
all VMs.

Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
---
This patch comes from before I started working on this at Unikie,
hence the non-Unikie author email.

host/start-vm/start-vm.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/host/start-vm/start-vm.rs b/host/start-vm/start-vm.rs
index 302c020..b2cccc8 100644
--- a/host/start-vm/start-vm.rs
+++ b/host/start-vm/start-vm.rs
@@ -30,7 +30,7 @@ fn vm_command(dir: PathBuf) -> Result<Command, String> {
command.arg("cloud-hypervisor");
command.args(&["--api-socket", "env/cloud-hypervisor.sock"]);
command.args(&["--cmdline", "console=ttyS0 root=PARTLABEL=root"]);
- command.args(&["--memory", "size=128M"]);
+ command.args(&["--memory", "size=128M,shared=on"]);
command.args(&["--console", "pty"]);

let mut net_providers_dir = PathBuf::new();
--
2.37.1