spice port selected from range so more than one vm can be run
This commit is contained in:
parent
21431084a7
commit
c63a17e93e
13
quickemu
13
quickemu
@ -104,6 +104,19 @@ function get_port() {
|
||||
done
|
||||
}
|
||||
|
||||
function get_spice_port() {
|
||||
local PORT_START=5930
|
||||
local PORT_RANGE=9
|
||||
while true; do
|
||||
local CANDIDATE=$[${PORT_START} + (${RANDOM} % ${PORT_RANGE})]
|
||||
(echo "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "${CANDIDATE}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
enable_usb_passthrough() {
|
||||
local DEVICE=""
|
||||
local USB_BUS=""
|
||||
|
Loading…
Reference in New Issue
Block a user