Revert "spice port selected from range so more than one vm can be run"
Similar patch already submitted which was done better.:
This commit is contained in:
parent
badfe09902
commit
1024663ff2
20
quickemu
20
quickemu
@ -104,19 +104,6 @@ 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=""
|
||||
@ -383,9 +370,6 @@ function vm_boot() {
|
||||
echo " - ssh: All ports for exposing ssh have been exhausted."
|
||||
fi
|
||||
|
||||
# Find a free port to connect to spice server
|
||||
local SPICE_PORT=$(get_spice_port)
|
||||
|
||||
enable_usb_passthrough
|
||||
|
||||
# Boot the iso image
|
||||
@ -454,7 +438,7 @@ function vm_boot() {
|
||||
-rtc base=localtime,clock=host \
|
||||
-object rng-random,id=rng0,filename=/dev/urandom \
|
||||
-device virtio-rng-pci,rng=rng0 \
|
||||
-spice port=${SPICE_PORT},disable-ticketing \
|
||||
-spice port=5930,disable-ticketing \
|
||||
-device virtio-serial-pci \
|
||||
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
|
||||
-chardev spicevmc,id=spicechannel0,name=vdagent \
|
||||
@ -479,7 +463,7 @@ function vm_boot() {
|
||||
-rtc base=localtime,clock=host \
|
||||
-object rng-random,id=rng0,filename=/dev/urandom \
|
||||
-device virtio-rng-pci,rng=rng0 \
|
||||
-spice port=${SPICE_PORT},disable-ticketing \
|
||||
-spice port=5930,disable-ticketing \
|
||||
-device virtio-serial-pci \
|
||||
-device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
|
||||
-chardev spicevmc,id=spicechannel0,name=vdagent \
|
||||
|
Loading…
Reference in New Issue
Block a user