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 <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221029114536.100268-1-luca@z3ntu.xyz%3E
This commit is contained in:
Luca Weiss 2022-10-29 13:45:35 +02:00 committed by Oliver Smith
parent 38f850161c
commit 0624a1ae33
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 2 additions and 4 deletions

View File

@ -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"]