From 888a0d5f74ec902e4d00de6a2013c4ad098d6a73 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 6 May 2023 23:01:56 +0100 Subject: [PATCH] mips-vm: allow env var to override la network interface this is handy if you want to connect to it from the host for e.g. seeing if min-copy-closure works --- pkgs/mips-vm/mips-vm.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/mips-vm/mips-vm.sh b/pkgs/mips-vm/mips-vm.sh index 91896d0..2f534ab 100755 --- a/pkgs/mips-vm/mips-vm.sh +++ b/pkgs/mips-vm/mips-vm.sh @@ -29,6 +29,8 @@ fi test -n "$2" || usage +lan=${LAN-"socket,mcast=230.0.0.1:1235,localaddr=127.0.0.1"} + rootfs=$(mktemp mips-vm-fs-XXXXXX) dd if=/dev/zero of=$rootfs bs=1M count=16 conv=sync dd if=$2 of=$rootfs bs=65536 conv=sync,nocreat,notrunc @@ -47,7 +49,7 @@ qemu-system-mips \ -drive file=$rootfs,format=raw,readonly=off,if=virtio,index=0 \ ${initramfs} \ -netdev socket,id=access,mcast=230.0.0.1:1234,localaddr=127.0.0.1 \ - -device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=access,mac=ba:ad:1d:ea:21:02 \ - -netdev socket,id=lan,mcast=230.0.0.1:1235,localaddr=127.0.0.1 \ - -device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=lan,mac=ba:ad:1d:ea:21:01 \ + -device virtio-net,disable-legacy=on,disable-modern=off,netdev=access,mac=ba:ad:1d:ea:21:02 \ + -netdev ${lan},id=lan \ + -device virtio-net,disable-legacy=on,disable-modern=off,netdev=lan,mac=ba:ad:1d:ea:21:01 \ -kernel $1 -display none $flags ${QEMU_OPTIONS}