mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
OPTS
This commit is contained in:
commit
a21536d03b
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
@ -11,4 +11,4 @@ jobs:
|
|||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@master
|
uses: ludeeus/action-shellcheck@master
|
||||||
env:
|
env:
|
||||||
SHELLCHECK_OPTS: -e SC2001 -e SC2002 -e SC2116 -e SC2034 -e SC1091 -e SC2143 -e SC2223 -e SC2086 -e SC2145 -e SC2015 -e SC2268 -e SC2207 -e SC2064 -e SC2162 -e SC2166
|
SHELLCHECK_OPTS: -e SC2001 -e SC2002 -e SC2116 -e SC2034 -e SC1091 -e SC2143 -e SC2223 -e SC2086 -e SC2145 -e SC2015 -e SC2268 -e SC2207 -e SC2064 -e SC2162 -e SC2153 -e SC2166
|
||||||
|
@ -125,7 +125,7 @@ if ((AGENT_VERSION < 5)); then
|
|||||||
echo "INFO: The installed VirtualDSM Agent v${AGENT_VERSION} is an outdated version, please upgrade it."
|
echo "INFO: The installed VirtualDSM Agent v${AGENT_VERSION} is an outdated version, please upgrade it."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
KVM_DISK_OPTS="\
|
DISK_OPTS="\
|
||||||
-device virtio-scsi-pci,id=hw-synoboot,bus=pcie.0,addr=0xa \
|
-device virtio-scsi-pci,id=hw-synoboot,bus=pcie.0,addr=0xa \
|
||||||
-drive file=${BOOT},if=none,id=drive-synoboot,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on \
|
-drive file=${BOOT},if=none,id=drive-synoboot,format=raw,cache=none,aio=native,discard=on,detect-zeroes=on \
|
||||||
-device scsi-hd,bus=hw-synoboot.0,channel=0,scsi-id=0,lun=0,drive=drive-synoboot,id=synoboot0,rotation_rate=1,bootindex=1 \
|
-device scsi-hd,bus=hw-synoboot.0,channel=0,scsi-id=0,lun=0,drive=drive-synoboot,id=synoboot0,rotation_rate=1,bootindex=1 \
|
||||||
|
@ -63,7 +63,7 @@ update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null
|
|||||||
|
|
||||||
VM_NET_TAP="_VmNatTap"
|
VM_NET_TAP="_VmNatTap"
|
||||||
configureNatNetworks
|
configureNatNetworks
|
||||||
KVM_NET_OPTS="-netdev tap,ifname=${VM_NET_TAP},script=no,downscript=no,id=hostnet0"
|
NET_OPTS="-netdev tap,ifname=${VM_NET_TAP},script=no,downscript=no,id=hostnet0"
|
||||||
|
|
||||||
# Build DNS options from container /etc/resolv.conf
|
# Build DNS options from container /etc/resolv.conf
|
||||||
nameservers=($(grep '^nameserver' /etc/resolv.conf | sed 's/nameserver //'))
|
nameservers=($(grep '^nameserver' /etc/resolv.conf | sed 's/nameserver //'))
|
||||||
@ -88,7 +88,7 @@ fi
|
|||||||
|
|
||||||
$DNSMASQ $DNSMASQ_OPTS
|
$DNSMASQ $DNSMASQ_OPTS
|
||||||
|
|
||||||
KVM_NET_OPTS="${KVM_NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
||||||
|
|
||||||
# Hack for guest VMs complaining about "bad udp checksums in 5 packets"
|
# Hack for guest VMs complaining about "bad udp checksums in 5 packets"
|
||||||
iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill
|
iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill
|
||||||
|
@ -84,4 +84,4 @@ _graceful_shutdown(){
|
|||||||
|
|
||||||
_trap _graceful_shutdown SIGTERM SIGHUP SIGINT SIGABRT SIGQUIT
|
_trap _graceful_shutdown SIGTERM SIGHUP SIGINT SIGABRT SIGQUIT
|
||||||
|
|
||||||
KVM_MON_OPTS="-monitor telnet:localhost:${QEMU_MONPORT},server,nowait,nodelay"
|
MON_OPTS="-monitor telnet:localhost:${QEMU_MONPORT},server,nowait,nodelay"
|
||||||
|
@ -40,21 +40,21 @@ fi
|
|||||||
# Configure shutdown
|
# Configure shutdown
|
||||||
. /run/power.sh
|
. /run/power.sh
|
||||||
|
|
||||||
KVM_ACC_OPTS=""
|
KVM_OPTS=""
|
||||||
|
|
||||||
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
if [ -e /dev/kvm ] && sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||||
if [[ $(grep -e vmx -e svm /proc/cpuinfo) ]]; then
|
if [[ $(grep -e vmx -e svm /proc/cpuinfo) ]]; then
|
||||||
KVM_ACC_OPTS="-machine type=q35,usb=off,accel=kvm -enable-kvm -cpu host"
|
KVM_OPTS="-machine type=q35,usb=off,accel=kvm -enable-kvm -cpu host"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "${KVM_ACC_OPTS}" ] && echo "Error: KVM acceleration is disabled.." && exit 88
|
[ -z "${KVM_OPTS}" ] && echo "Error: KVM acceleration is disabled.." && exit 88
|
||||||
|
|
||||||
DEF_OPTS="-nographic"
|
DEF_OPTS="-nographic"
|
||||||
RAM_OPTS=$(echo "-m ${RAM_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
|
RAM_OPTS=$(echo "-m ${RAM_SIZE}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
|
||||||
CPU_OPTS="-smp ${CPU_CORES},sockets=${CPU_CORES},cores=1,threads=1"
|
CPU_OPTS="-smp ${CPU_CORES},sockets=${CPU_CORES},cores=1,threads=1"
|
||||||
EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4 -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0"
|
EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4 -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0"
|
||||||
ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_ACC_OPTS} ${KVM_MON_OPTS} ${KVM_SERIAL_OPTS} ${KVM_NET_OPTS} ${KVM_DISK_OPTS} ${EXTRA_OPTS}"
|
ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${KVM_OPTS} ${MON_OPTS} ${SERIAL_OPTS} ${NET_OPTS} ${DISK_OPTS} ${EXTRA_OPTS}"
|
||||||
|
|
||||||
set -m
|
set -m
|
||||||
(
|
(
|
||||||
|
@ -30,7 +30,7 @@ fi
|
|||||||
-buildnumber="${HOST_BUILD}" \
|
-buildnumber="${HOST_BUILD}" \
|
||||||
-guestuuid="${GUEST_UUID}" > /dev/null 2>&1 &
|
-guestuuid="${GUEST_UUID}" > /dev/null 2>&1 &
|
||||||
|
|
||||||
KVM_SERIAL_OPTS="\
|
SERIAL_OPTS="\
|
||||||
-serial mon:stdio \
|
-serial mon:stdio \
|
||||||
-device virtio-serial-pci,id=virtio-serial0,bus=pcie.0,addr=0x3 \
|
-device virtio-serial-pci,id=virtio-serial0,bus=pcie.0,addr=0x3 \
|
||||||
-chardev pty,id=charserial0 \
|
-chardev pty,id=charserial0 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user