From 0624a1ae33a2ddb32c13a569cd0b5867225c7163 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Sat, 29 Oct 2022 13:45:35 +0200 Subject: [PATCH] pmb.qemu.run: replace -nic option with -netdev and -device On qemu-system-riscv64 the -nic option doesn't seem to work correctly. qemu-system-riscv64: warning: requested NIC (anonymous, model virtio-net-pci) was not created (not supported by this machine?) Using -netdev and -device provides the same functionality and also works on riscv64. Reviewed-by: Oliver Smith Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221029114536.100268-1-luca@z3ntu.xyz%3E --- pmb/qemu/run.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 36e4aef4..c2cbe01a 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -184,10 +184,8 @@ def command_qemu(args, arch, img_path, img_path_2nd=None): else: command += ["-device", "virtio-mouse-pci"] command += ["-device", "virtio-keyboard-pci"] - command += ["-nic", - "user,model=virtio-net-pci," - "hostfwd=tcp::" + port_ssh + "-:22," - ] + command += ["-netdev", "user,id=net,hostfwd=tcp::" + port_ssh + "-:22"] + command += ["-device", "virtio-net-pci,netdev=net"] if arch == "x86_64": command += ["-vga", "virtio"]