vms/run: make portmap a dict to fix serializer
This commit is contained in:
@@ -92,11 +92,11 @@ def qemu_command(
|
||||
virtiofsd_socket: Path,
|
||||
qmp_socket_file: Path,
|
||||
qga_socket_file: Path,
|
||||
portmap: list[tuple[int, int]] | None = None,
|
||||
portmap: dict[int, int] | None = None,
|
||||
interactive: bool = False,
|
||||
) -> QemuCommand:
|
||||
if portmap is None:
|
||||
portmap = []
|
||||
portmap = {}
|
||||
kernel_cmdline = [
|
||||
(Path(nixos_config["toplevel"]) / "kernel-params").read_text(),
|
||||
f'init={nixos_config["toplevel"]}/init',
|
||||
@@ -105,7 +105,7 @@ def qemu_command(
|
||||
]
|
||||
if not vm.waypipe:
|
||||
kernel_cmdline.append("console=tty0")
|
||||
hostfwd = ",".join(f"hostfwd=tcp::{h}-:{g}" for h, g in portmap)
|
||||
hostfwd = ",".join(f"hostfwd=tcp::{h}-:{g}" for h, g in portmap.items())
|
||||
# fmt: off
|
||||
command = [
|
||||
"qemu-kvm",
|
||||
|
||||
Reference in New Issue
Block a user