summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-10-10 23:28:41 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-26 15:58:49 +0000
commitc85b5d529a6d4ab28a93aa1e9b3f3f6459daca50 (patch)
treea93b13f34be72c1dccec73982a0e25489d9e69b8
parent629fd0811fdea5b6bd0281ed5e21aff6e119e9a9 (diff)
downloadspectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar.gz
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar.bz2
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar.lz
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar.xz
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.tar.zst
spectrum-c85b5d529a6d4ab28a93aa1e9b3f3f6459daca50.zip
host/start-vm: use MAP_SHARED memory for VMs
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 <hi@alyssa.is>
Message-Id: <20221010232909.1953738-2-hi@alyssa.is>
-rw-r--r--host/start-vm/lib.rs2
-rw-r--r--host/start-vm/tests/vm_command-basic.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/host/start-vm/lib.rs b/host/start-vm/lib.rs
index ef79091..9a92ab7 100644
--- a/host/start-vm/lib.rs
+++ b/host/start-vm/lib.rs
@@ -44,7 +44,7 @@ pub fn vm_command(dir: PathBuf, config_root: &Path) -> 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"]);
     command.arg("--kernel");
     command.arg(config_dir.join("vmlinux"));
diff --git a/host/start-vm/tests/vm_command-basic.rs b/host/start-vm/tests/vm_command-basic.rs
index b9585f9..4145b94 100644
--- a/host/start-vm/tests/vm_command-basic.rs
+++ b/host/start-vm/tests/vm_command-basic.rs
@@ -37,7 +37,7 @@ fn main() -> std::io::Result<()> {
         OsStr::new("--cmdline"),
         OsStr::new("console=ttyS0 root=PARTLABEL=root"),
         OsStr::new("--memory"),
-        OsStr::new("size=128M"),
+        OsStr::new("size=128M,shared=on"),
         OsStr::new("--console"),
         OsStr::new("pty"),
         OsStr::new("--kernel"),