refactor: move all port checks to ports_param_check()

This commit is contained in:
Martin Wimpress 2024-05-14 10:06:53 +01:00 committed by Martin Wimpress
parent 124202511a
commit cbc3c20104
1 changed files with 10 additions and 10 deletions

View File

@ -1242,11 +1242,6 @@ function vm_boot() {
-device tpm-tis,tpmdev=tpm0)
fi
if [ -n "${monitor_telnet_port}" ] && ! is_numeric "${monitor_telnet_port}"; then
echo "ERROR: telnet port must be a number!"
exit 1
fi
if [ "${monitor}" == "none" ]; then
args+=(-monitor none)
echo " - Monitor: (off)"
@ -1272,11 +1267,6 @@ function vm_boot() {
exit 1
fi
if [ -n "${serial_telnet_port}" ] && ! is_numeric "${serial_telnet_port}"; then
echo "ERROR: serial port must be a number!"
exit 1
fi
if [ "${serial}" == "none" ]; then
args+=(-serial none)
echo " - Serial: (off)"
@ -1485,6 +1475,16 @@ function ports_param_check() {
echo "ERROR: spice_port must be a number!"
exit 1
fi
if [ -n "${monitor_telnet_port}" ] && ! is_numeric "${monitor_telnet_port}"; then
echo "ERROR: telnet port must be a number!"
exit 1
fi
if [ -n "${serial_telnet_port}" ] && ! is_numeric "${serial_telnet_port}"; then
echo "ERROR: serial port must be a number!"
exit 1
fi
}
function sound_card_param_check() {