Description of problem:
If specify invalid vnc port value in qemu-kvm command line, the qemu should quit with friendly prompt. Also tried the spice that has no such issue.
Version-Release number of selected component (if applicable):
host info:
2.6.32-402.el6.x86_64
qemu-kvm-0.12.1.2-2.381.el6.x86_64
seabios-0.6.1.2-28.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
...-vnc host:display
If you do not specify host, connections will be accepted from any host, The TCP port on which the VNC session is then running is normally a 5900 + display number.
1.# /usr/libexec/qemu-kvm -vnc :aaaa -monitor stdio
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) info vnc
Server:
address: 0.0.0.0:5900
auth: none
Client: none
(qemu) q
2.# /usr/libexec/qemu-kvm -vnc :99999999999 -monitor stdio
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) info vnc
Server:
address: 0.0.0.0:65291
auth: none
Client: none
(qemu) q
3.# /usr/libexec/qemu-kvm -vnc :-10 -monitor stdio
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) info vnc
Server:
address: 0.0.0.0:5890
auth: none
Client: none
(qemu) q
4.# /usr/libexec/qemu-kvm -vnc :-999 -monitor stdio
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) info vnc
Server:
address: 0.0.0.0:4901
auth: none
Client: none
(qemu)
5.# /usr/libexec/qemu-kvm -vnc :-9999 -monitor stdio
Failed to start VNC server on `:-9999': address resolution failed for :-4099: Servname not supported for ai_socktype
Actual results:
Expected results:
Qemu should quit with a friendly prompt, like:
for step 1, qemu quit with prompt: Parameter 'port' expects a number
for step 2, qemu quit with prompt: -vnc port value is out of range
...
Additional info:
Also tried the spice, testing as following.
# /usr/libexec/qemu-kvm -spice port=999999999,disable-ticketing -monitor stdio
spice port is out of range
# /usr/libexec/qemu-kvm -spice port=aaaa,disable-ticketing -monitor stdio
qemu-kvm: -spice port=aaaa,disable-ticketing: Parameter 'port' expects a number
parse error: port=aaaa,disable-ticketing
# /usr/libexec/qemu-kvm -spice port=-9999,disable-ticketing -monitor stdio
spice port is out of range
# /usr/libexec/qemu-kvm -spice port=-1,disable-ticketing -monitor stdio
spice port is out of range
# /usr/libexec/qemu-kvm -spice port=0,disable-ticketing -monitor stdio
neither port nor tls-port specified for spice.
# /usr/libexec/qemu-kvm -spice port=1,disable-ticketing -monitor stdio
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) info spice
Server:
migrated: false
address: 0.0.0.0:1
auth: none
Channels: none
(qemu) q