* [PATCH] host/rootfs: Add scripts to access a VM by name
@ 2025-12-05 10:06 Demi Marie Obenour
0 siblings, 0 replies; 2+ messages in thread
From: Demi Marie Obenour @ 2025-12-05 10:06 UTC (permalink / raw)
To: Spectrum OS Development; +Cc: Alyssa Ross, Demi Marie Obenour
This is much more convenient than having to find a VM's ID.
In the future, the programs that take a VM ID should be the suffixed
ones, but this change avoids having to change any tests and so is
simpler.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
host/rootfs/file-list.mk | 3 +++
host/rootfs/image/usr/bin/vm-console-by-name | 9 +++++++++
host/rootfs/image/usr/bin/vm-start-by-name | 9 +++++++++
host/rootfs/image/usr/bin/vm-stop-by-name | 9 +++++++++
4 files changed, 30 insertions(+)
diff --git a/host/rootfs/file-list.mk b/host/rootfs/file-list.mk
index df22bce87f4685eda26382b4e0b0b6fd21025c7a..fd21034320a3de6f96a8eb229214b041612709e8 100644
--- a/host/rootfs/file-list.mk
+++ b/host/rootfs/file-list.mk
@@ -59,9 +59,12 @@ FILES = \
image/usr/bin/run-vmm \
image/usr/bin/spectrum-update \
image/usr/bin/vm-console \
+ image/usr/bin/vm-console-by-name \
image/usr/bin/vm-import \
image/usr/bin/vm-start \
+ image/usr/bin/vm-start-by-name \
image/usr/bin/vm-stop \
+ image/usr/bin/vm-stop-by-name \
image/usr/bin/xdg-open \
image/usr/libexec/net-add \
image/usr/share/dbus-1/services/org.freedesktop.portal.Documents.service
diff --git a/host/rootfs/image/usr/bin/vm-console-by-name b/host/rootfs/image/usr/bin/vm-console-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..a302b463ef1bd2c9ae180b6b2b9eae45a26856d6
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-console-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-console $vm_id
diff --git a/host/rootfs/image/usr/bin/vm-start-by-name b/host/rootfs/image/usr/bin/vm-start-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..438a4a4610ddc9dea3394503e8d5e635468fbddd
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-start-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-start $vm_id
diff --git a/host/rootfs/image/usr/bin/vm-stop-by-name b/host/rootfs/image/usr/bin/vm-stop-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..07ca686b5ace86aceb0fdc0f9ace8ff3859f2b37
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-stop-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-stop $vm_id
---
base-commit: a13d3403c1ddbb8dbbbdb05416350b2846162ed1
change-id: 20251201-vm-ops-by-name-6a5cb600f726
--
Sincerely,
Demi Marie Obenour (she/her/hers)
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] host/rootfs: Add scripts to access a VM by name
@ 2025-12-01 22:13 Demi Marie Obenour
0 siblings, 0 replies; 2+ messages in thread
From: Demi Marie Obenour @ 2025-12-01 22:13 UTC (permalink / raw)
To: Spectrum OS Development; +Cc: Alyssa Ross, Demi Marie Obenour
This is much more convenient than having to find a VM's ID.
In the future, the programs that take a VM ID should be the suffixed
ones, but this change avoids having to change any tests and so is
simpler.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
host/rootfs/file-list.mk | 3 +++
host/rootfs/image/usr/bin/vm-console-by-name | 9 +++++++++
host/rootfs/image/usr/bin/vm-start-by-name | 9 +++++++++
host/rootfs/image/usr/bin/vm-stop-by-name | 9 +++++++++
4 files changed, 30 insertions(+)
diff --git a/host/rootfs/file-list.mk b/host/rootfs/file-list.mk
index df22bce87f4685eda26382b4e0b0b6fd21025c7a..fd21034320a3de6f96a8eb229214b041612709e8 100644
--- a/host/rootfs/file-list.mk
+++ b/host/rootfs/file-list.mk
@@ -59,9 +59,12 @@ FILES = \
image/usr/bin/run-vmm \
image/usr/bin/spectrum-update \
image/usr/bin/vm-console \
+ image/usr/bin/vm-console-by-name \
image/usr/bin/vm-import \
image/usr/bin/vm-start \
+ image/usr/bin/vm-start-by-name \
image/usr/bin/vm-stop \
+ image/usr/bin/vm-stop-by-name \
image/usr/bin/xdg-open \
image/usr/libexec/net-add \
image/usr/share/dbus-1/services/org.freedesktop.portal.Documents.service
diff --git a/host/rootfs/image/usr/bin/vm-console-by-name b/host/rootfs/image/usr/bin/vm-console-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..a302b463ef1bd2c9ae180b6b2b9eae45a26856d6
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-console-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-console $vm_id
diff --git a/host/rootfs/image/usr/bin/vm-start-by-name b/host/rootfs/image/usr/bin/vm-start-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..438a4a4610ddc9dea3394503e8d5e635468fbddd
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-start-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-start $vm_id
diff --git a/host/rootfs/image/usr/bin/vm-stop-by-name b/host/rootfs/image/usr/bin/vm-stop-by-name
new file mode 100755
index 0000000000000000000000000000000000000000..07ca686b5ace86aceb0fdc0f9ace8ff3859f2b37
--- /dev/null
+++ b/host/rootfs/image/usr/bin/vm-stop-by-name
@@ -0,0 +1,9 @@
+#!/bin/execlineb -WS1
+# SPDX-License-Identifier: EUPL-1.2+
+# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
+# SPDX-FileCopyrightText: 2022-2023, 2025 Alyssa Ross <hi@alyssa.is>
+backtick -E vm_id {
+ backtick -E id_path { readlink /run/vm/by-name/${1} }
+ basename -- $id_path
+}
+vm-stop $vm_id
---
base-commit: 44f32b7a4b3cfbb4046447318e6753dd0eb71add
change-id: 20251201-vm-ops-by-name-6a5cb600f726
--
Sincerely,
Demi Marie Obenour (she/her/hers)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-05 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 10:06 [PATCH] host/rootfs: Add scripts to access a VM by name Demi Marie Obenour
-- strict thread matches above, loose matches on Subject: below --
2025-12-01 22:13 Demi Marie Obenour
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).