aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 19:09:08 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 19:09:08 -0200
commit79dceafaec991c67822ebce8d998bc775f7afb46 (patch)
tree033f98046efbdb621c44926e8d6b7ce50eb13b0c
parentcd3cd088944e715ab70f94ca07220d9f70992464 (diff)
downloadkvmx-79dceafaec991c67822ebce8d998bc775f7afb46.tar.gz
kvmx-79dceafaec991c67822ebce8d998bc775f7afb46.tar.bz2
Updates net_opts
-rwxr-xr-xkvmx5
1 files changed, 2 insertions, 3 deletions
diff --git a/kvmx b/kvmx
index cb0e31b..242a3ff 100755
--- a/kvmx
+++ b/kvmx
@@ -373,14 +373,14 @@ function kvmx_up {
fi
if [ -z "$net" ] || [ "$net" == "user" ]; then
- net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd"
+ net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd -net nic,model=$nic_model"
elif [ "$net" == "tap" ]; then
# Thanks kvm-manager
tap="${VM}0"
# MAC address is derived from a hash of the host's name and the guest's name:
mac_address="$(printf "02:%s" "$(printf "%s\0%s" "$(hostname)" "${VM}" | sha256sum | sed 's/\(..\)/\1:/g' | cut -f1-5 -d:)")"
bridge="br0"
- net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0"
+ net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0 -device virtio-net-pci,vlan=0,id=net0,mac=$mac_address,bus=pci.0"
fi
# Run virtual machine
@@ -394,7 +394,6 @@ function kvmx_up {
-chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-chardev "socket,id=serial0,path=$CONSOLEFILE,server" -device isa-serial,chardev=serial0 \
-smp $smp -soundhw ac97 -cpu host -balloon virtio \
- -net nic,model=$nic_model \
-net $net_opts \
$qemu_opts &> $LOGFILE < /dev/null &