[PATCH v2 4/6] host/start-vm: boot using partition label

Alyssa Ross
2022-10-10T23:33:16Z

This will allow booting reliably from multiple disk images, without
relying on order.

Thanks-to: Puck Meerburg <puck@puckipedia.com>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
host/start-vm/lib.rs | 2 +-
host/start-vm/tests/vm_command-basic.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/host/start-vm/lib.rs b/host/start-vm/lib.rs
index 5d43a3e..ef79091 100644
--- a/host/start-vm/lib.rs
+++ b/host/start-vm/lib.rs
@@ -43,7 +43,7 @@ pub fn vm_command(dir: PathBuf, config_root: &Path) -> Result<Command, String> {
command.args(&["-dc", "test -S env/cloud-hypervisor.sock"]);
command.arg("cloud-hypervisor");
command.args(&["--api-socket", "env/cloud-hypervisor.sock"]);
- command.args(&["--cmdline", "console=ttyS0 root=/dev/vda"]);
+ command.args(&["--cmdline", "console=ttyS0 root=PARTLABEL=root"]);
command.args(&["--memory", "size=128M"]);
command.args(&["--console", "pty"]);
command.arg("--kernel");
diff --git a/host/start-vm/tests/vm_command-basic.rs b/host/start-vm/tests/vm_command-basic.rs
index a577a71..b9585f9 100644
--- a/host/start-vm/tests/vm_command-basic.rs
+++ b/host/start-vm/tests/vm_command-basic.rs
@@ -35,7 +35,7 @@ fn main() -> std::io::Result<()> {
OsStr::new("--api-socket"),
OsStr::new("env/cloud-hypervisor.sock"),
OsStr::new("--cmdline"),
- OsStr::new("console=ttyS0 root=/dev/vda"),
+ OsStr::new("console=ttyS0 root=PARTLABEL=root"),
OsStr::new("--memory"),
OsStr::new("size=128M"),
OsStr::new("--console"),
--
2.37.1