patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH 1/2] tools: start-vmm: output serial to VM directory
Date: Sun, 14 Dec 2025 01:26:19 +0100	[thread overview]
Message-ID: <20251214002620.741841-1-hi@alyssa.is> (raw)

When we run the VMM as non-root, it shouldn't be able to create files
directly under /run, so this needs to go somewhere else.

Really this should probably be going through s6-log, but I think it
makes sense to revisit that after we have persistent storage figured
out, so that we can get lots out of RAM.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 release/checks/integration/networking.c   | 2 +-
 release/checks/integration/portal.c       | 2 +-
 tools/start-vmm/lib.rs                    | 2 +-
 tools/start-vmm/tests/vm_command-basic.rs | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/release/checks/integration/networking.c b/release/checks/integration/networking.c
index 078e31fc..c3d873f5 100644
--- a/release/checks/integration/networking.c
+++ b/release/checks/integration/networking.c
@@ -153,7 +153,7 @@ void test(struct config c)
 	          "s6-rc -bu change vmm-env && "
 	          "vm-import user /run/mnt/vms && "
 	          "vm-start \"$(basename \"$(readlink /run/vm/by-name/user.nc)\")\" && "
-	          "tail -Fc +0 /run/log/current /run/*.log &\n",
+	          "tail -Fc +0 /run/log/current /run/vm/by-id/*/serial &\n",
 	          vm_console_writer(vm)) == EOF) {
 		fputs("error writing to console\n", stderr);
 		exit(EXIT_FAILURE);
diff --git a/release/checks/integration/portal.c b/release/checks/integration/portal.c
index 6ba5654a..9af225e5 100644
--- a/release/checks/integration/portal.c
+++ b/release/checks/integration/portal.c
@@ -17,7 +17,7 @@ void test(struct config c)
 	          "mount \"$(findfs UUID=a7834806-2f82-4faf-8ac4-4f8fd8a474ca)\" /run/mnt && "
 	          "s6-rc -bu change vmm-env && "
 	          "vm-import user /run/mnt/vms && "
-	          "(tail -Fc +0 /run/*.log &) && "
+	          "(tail -Fc +0 /run/vm/by-id/*/serial &) && "
 	          "s6-svc -O /run/vm/by-name/user.portal/service && "
 	          "vm-start \"$(basename \"$(readlink /run/vm/by-name/user.portal)\")\" && "
 	          "s6-svwait -d /run/vm/by-name/user.portal/service\n",
diff --git a/tools/start-vmm/lib.rs b/tools/start-vmm/lib.rs
index dfbca8d8..a536f0f6 100644
--- a/tools/start-vmm/lib.rs
+++ b/tools/start-vmm/lib.rs
@@ -160,7 +160,7 @@ pub fn vm_config(vm_dir: &Path) -> Result<VmConfig, String> {
         },
         serial: ConsoleConfig {
             mode: "File",
-            file: Some(format!("/run/{vm_name}.log")),
+            file: Some(format!("/run/vm/by-id/{vm_name}/serial")),
         },
         vsock: VsockConfig {
             cid: 3,
diff --git a/tools/start-vmm/tests/vm_command-basic.rs b/tools/start-vmm/tests/vm_command-basic.rs
index 95c43f86..2e9ad0c7 100644
--- a/tools/start-vmm/tests/vm_command-basic.rs
+++ b/tools/start-vmm/tests/vm_command-basic.rs
@@ -40,7 +40,7 @@ fn main() -> std::io::Result<()> {
     assert_eq!(config.memory.size, 0x40000000);
     assert!(config.memory.shared);
     assert_eq!(config.serial.mode, "File");
-    assert_eq!(config.serial.file.unwrap(), "/run/testvm.log");
+    assert_eq!(config.serial.file.unwrap(), "/run/vm/by-id/testvm/serial");
     assert_eq!(config.vsock.cid, 3);
     assert_eq!(config.vsock.socket, "/run/vsock/testvm/vsock");
 

base-commit: 227a3ea149281b6dddb0c1ba70008fffb7404c1f
-- 
2.51.0


             reply	other threads:[~2025-12-14  0:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-14  0:26 Alyssa Ross [this message]
2025-12-14  0:26 ` [PATCH 2/2] host/rootfs: run Cloud Hypervisor as non-root Alyssa Ross
2025-12-14 12:55   ` Alyssa Ross
2025-12-14 12:55 ` [PATCH 1/2] tools: start-vmm: output serial to VM directory Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251214002620.741841-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).