From e0640333d0e9eb872a3abf68a9da1685ab570076 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 02:59:16 +0000 Subject: run-firecracker-vm: --egress defaults to the VM's name A named VM uses the list of the same name unless given another with --egress; without a name, still the list default. A missing list means no egress (with a warning), as before; there's no fallback to default. --- pkgs/run-firecracker-vm/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgs/run-firecracker-vm') diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix index 223654a..f77520e 100644 --- a/pkgs/run-firecracker-vm/default.nix +++ b/pkgs/run-firecracker-vm/default.nix @@ -320,8 +320,8 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' # when the guest exits, or with --store, to FILE, which keeps it across # boots (created if it doesn't exist, of --store-size, default 16G; the # file is sparse, so that's only an upper limit). - # The guest's egress goes by the user's whitelist LIST (default: - # default), see modules/host and fc-egress. --name names the VM, for + # The guest's egress goes by the user's whitelist LIST (default: the + # VM's name, or without one, default), see modules/host and fc-egress. --name names the VM, for # fc-egress and as the guest's host name; only one running VM of the # user's can have a given name. set -efu @@ -333,7 +333,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' args= rw_store= rw_store_size=16G - egress=default + egress= name= nixpkgs=${lib.escapeShellArg (toString pkgs.path)} while test $# -gt 0; do @@ -349,6 +349,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' *) usage >&2; exit 1 esac done + egress=''${egress:-''${name:-default}} tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT -- cgit v1.3.1