Reveal 'to' parameter of 'vnc' option to user
cover Reveal 'to' parameter of 'vnc' option to user
(If you received this patch set several times, I appologize, I met some problem in the smtp setting.)
I find that '-vnc' option actually has a parameter 'to', implicitly; while actually is there and can be used but not be public. Don't know why but this may probably confuse user, especially when used in some default situation implicitly.
So shall I?
1. Add its description in QEMU manual info
2. Expilicitly print out when it's used with non-default value
Robert Ho (2):
Reveal 'to' param of '-vnc' option in qemu man page Explicitly print out default vnc option in use
qemu-options.hx | 7 +++++++ vl.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 Reveal 'to' param of '-vnc' option in qemu man page
Add the descrption of the 'to' param of 'vnc' option in QEMU man page.
--- qemu-options.hx | 7 +++++++ 1 file changed, 7 insertions(+)
qemu-options.hx +7 -0
@@ -1241,6 +1241,13 @@ syntax for the @var{display} is @table @option +@item to=@var{L} + +With this option, QEMU will try next available VNC @var{display}s, until the +number @var{L}, if the origianlly defined "-vnc @var{display}" is not +available, e.g. port 5900+@var{display} is already used by another +application. By default, to=0. + @item @var{host}:@var{d} TCP connections will only be allowed from @var{host} on display @var{d}.
Signature · 1 line
1.8.3.1
PATCH 2/2 Explicitly print out default vnc option in use
In reply to Robert HoIf no display option defined in QEMU command line, and SDL is not available, then it by default uses '-vnc localhost:0,to=99,id=default'. This patch simply print out the default option parameters out, so that user is aware of that.
--- vl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
vl.c +4 -1
@@ -4213,7 +4213,10 @@ int main(int argc, char **argv, char **envp)#elif defined(CONFIG_COCOA ) display_type =DT_COCOA ;#elif defined(CONFIG_VNC ) -vnc_parse ("localhost:0,to=99,id=default" , &error_abort); +#define DEFAULT_VNC_DISPLAY_OPTION "localhost:0,to=99,id=default" +vnc_parse (DEFAULT_VNC_DISPLAY_OPTION , &error_abort); +printf ("No display option defined, using '-vnc %s' by default \ +\n" ,DEFAULT_VNC_DISPLAY_OPTION ); show_vnc_port =1 ;#else display_type =DT_NONE ;
Signature · 1 line
1.8.3.1
Quoted 8 lines · Robert Ho
I find that '-vnc' option actually has a parameter 'to', implicitly; while actually is there and can be used but not be public. Don't know why but this may probably confuse user, especially when used in some default situation implicitly.
So shall I?
1. Add its description in QEMU manual info
2. Expilicitly print out when it's used with non-default value
I think patch 1 is okay.
For patch 2, I am not sure I see the point of printing the VNC options; the VNC port is printed immediately after.
However, I think it is useful to print the VNC port whenever the user specifies "-vnc to=XX". Perhaps you could move show_vnc_port (the variable, the assignments and the "if (show_vnc_port)") from vl.c to vnc_display_open?
Thanks,
Paolo
Quoted 7 lines · Paolo Bonzini
Quoted 5 lines · Robert Ho
I find that '-vnc' option actually has a parameter 'to', implicitly; while actually is there and can be used but not be public. Don't know why but this may probably confuse user, especially when used in some default situation implicitly.
Quoted 5 lines
Quoted 3 lines
So shall I?
1. Add its description in QEMU manual info
2. Expilicitly print out when it's used with non-default valueI think patch 1 is okay.
Thanks Paolo. Sorry for late reply, since I just part-time work on this.
Quoted 3 lines
For patch 2, I am not sure I see the point of printing the VNC options; the VNC port is printed immediately after.
I agree it is not significantly meaningful to print out the options. I just disliked the implicitly be-on-behalf-chose a value without notification; especially we don't know there is a 'to' option. So when I did the density test of huge quantity of guests, always failed on 99th, made me quizzical. :(
In most ordinary cases, the final 'VNC server running on ...' printf is sufficient.
Now my that emotion gradually die out, I agree abandon patch 2. :)
Quoted 5 lines
However, I think it is useful to print the VNC port whenever the user specifies "-vnc to=XX". Perhaps you could move
show_vnc_port(the variable, the assignments and the "if (show_vnc_port)") fromvl.ctovnc_display_open?
And 2nd reason I abandon patch 2: I grepped in vnc.c, no bare 'printf'. Any nice wrapper for such info purpose? I don't want to be first 'bad guy' to break the elegant code. ;)
So do I need to send out v2 patch? which simply contains single patch 1.
Quoted 4 lines
Thanks,
Paolo