fix #4 (really): use -device and -netdev options instead of -redir

The correct arguments to qemu are

	-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013
		to forward several host ports to the guests ports on ethernet.0
	-device rtl8139,netdev=ethernet.0
		to define the emulated hardware of ethernet.0

They are both required and the netdev's value of the -device option
must match the id's value of the -netdev option.
This commit is contained in:
Giacomo Tesio 2017-09-04 22:56:36 +02:00
parent 39de8b3851
commit e286892bf9
3 changed files with 8 additions and 18 deletions

8
QA.sh
View File

@ -66,12 +66,8 @@ $kvmdo qemu-system-x86_64 -s -cpu $CPU_MODEL -smp $NCPU -m 2048 $kvmflag \
--monitor /dev/null \
--machine $machineflag \
$bootDisk \
-net nic,model=rtl8139 \
-net user,hostfwd=tcp::5555-:1522 \
-net dump,file=/tmp/vm0.pcap \
-netdev user,id=tcp9,hostfwd=tcp::9999-:9 \
-netdev user,id=tcp17010,hostfwd=tcp::17010-:17010 \
-netdev user,id=tcp17013,hostfwd=tcp::17013-:17013 \
-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013 \
-device rtl8139,netdev=ethernet.0 \
$appendLine $kernelLine
EOF

View File

@ -58,12 +58,8 @@ $kvmdo qemu-system-x86_64 -s -cpu Haswell -smp $NCPU -m 2048 $kvmflag \
-no-reboot -serial mon:stdio \
--machine $machineflag \
$bootDisk \
-net nic,model=rtl8139 \
-net user,hostfwd=tcp::5555-:1522 \
-net dump,file=/tmp/vm0.pcap \
-netdev user,id=tcp9,hostfwd=tcp::9999-:9 \
-netdev user,id=tcp17010,hostfwd=tcp::17010-:17010 \
-netdev user,id=tcp17013,hostfwd=tcp::17013-:17013
-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013 \
-device rtl8139,netdev=ethernet.0
EOF
# To enable qemu log:

View File

@ -58,12 +58,8 @@ $kvmdo qemu-system-x86_64 -s -cpu Haswell -smp $NCPU -m 2048 $kvmflag \
-no-reboot -serial mon:stdio \
--machine $machineflag \
$bootDisk \
-net nic,model=rtl8139 \
-net user,hostfwd=tcp::5555-:1522 \
-net dump,file=/tmp/vm0.pcap \
-netdev user,id=tcp9,hostfwd=tcp::9999-:9 \
-netdev user,id=tcp17010,hostfwd=tcp::17010-:17010 \
-netdev user,id=tcp17013,hostfwd=tcp::17013-:17013 \
-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013 \
-device rtl8139,netdev=ethernet.0 \
$usbDev \
-append "maxcores=1024 nvram=$NVRAM nvrlen=512 nvroff=0 console=0 qemu-user=$QEMU_USER *acpi= $FS $KAPPEND" \
-initrd ./initrd \
@ -73,6 +69,8 @@ EOF
# To enable qemu log:
#-D $JEHANNE/../qemu.log -d int,cpu_reset,in_asm \
#-net dump,file=/tmp/vm0.pcap \
echo $cmd
eval $cmd