Statistics
| Branch: | Revision:

root / ui / vnc.c @ 834574ea

History | View | Annotate | Download (93.1 kB)

# Date Author Comment
32ed2680 01/21/2013 09:33 pm Tim Hardeck

vnc: added buffer_advance function

Following Anthony Liguori's Websocket implementation I have added the
buffer_advance function to VNC and replaced all related buffer memmove
operations with it.

Signed-off-by: Tim Hardeck <>
Reviewed-by: Anthony Liguori <>...

7536ee4b 01/21/2013 09:33 pm Tim Hardeck

vnc: added initial websocket protocol support

This patch adds basic Websocket Protocol version 13 - RFC 6455 - support
to QEMU VNC. Binary encoding support on the client side is mandatory.

Because of the GnuTLS requirement the Websockets implementation is...

6fd8e79a 01/21/2013 09:33 pm Tim Hardeck

vnc: fix possible uninitialized removals

Some VncState values are not initialized before the Websocket handshake.
If it fails QEMU segfaults during the cleanup. To prevent this behavior
intialization checks are added.

Signed-off-by: Tim Hardeck <>...

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

7b1b5d19 12/19/2012 09:31 am Paolo Bonzini

qapi: move include files to include/qobject/

Signed-off-by: Paolo Bonzini <>

bc210eb1 12/14/2012 10:56 pm Gerd Hoffmann

pixman: fix vnc tight png/jpeg support

This patch adds an x argument to qemu_pixman_linebuf_fill so it can
also be used to convert a partial scanline. Then fix tight + png/jpeg
encoding by passing in the x+y offset, so the data is read from the
correct screen location instead of the upper left corner....

7eff5742 11/26/2012 04:16 pm Catalin Patulea

vnc: fix option misspelling ("non-adapative" -> "non-adaptive")

Signed-off-by: Catalin Patulea <>
Signed-off-by: Anthony Liguori <>

ef84755e 11/03/2012 02:55 pm Blue Swirl

Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

  • 'trivial-patches' of git://github.com/stefanha/qemu:
    pc: Drop redundant test for ROM memory region
    exec: make some functions static
    target-ppc: make some functions static
    ppc: add missing static...
71a8cdec 11/01/2012 08:49 pm Blue Swirl

vnc: add missing static

Add missing 'static' qualifiers.

Signed-off-by: Blue Swirl <>
Signed-off-by: Stefan Hajnoczi <>

94362682 11/01/2012 03:00 pm Gerd Hoffmann

pixman/vnc: remove dead code.

Switching the vnc server framebuffer to use 32bpp unconditionally
turns the code bits which handle 8 and 16 bpp into dead code.
Remove them.

Signed-off-by: Gerd Hoffmann <>

9f64916d 11/01/2012 03:00 pm Gerd Hoffmann

pixman/vnc: use pixman images in vnc.

The vnc code uses three DisplaySurfaces:

First is the surface of the actual QemuConsole, usually the guest
screen, but could also be a text console (monitor/serial reachable via
Ctrl-Alt-<nr> keys). This is left as-is....

a93a4a22 11/01/2012 02:10 pm Gerd Hoffmann

console: untangle gfx & txt updates

Stop abusing displaysurface fields for text mode displays.
(bpp = 0, width = cols, height = lines).

Add flags to displaystate indicating whenever text mode display
(curses) or gfx mode displays (sdl, vnc, ...) are present....

bf2fde70 11/01/2012 02:10 pm Gerd Hoffmann

console: move set_mouse + cursor_define callbacks

When adding DisplayChangeListeners the set_mouse and cursor_define
callbacks have been left in DisplayState for some reason. Fix it.

Signed-off-by: Gerd Hoffmann <>

2d55f0e8 10/23/2012 02:54 pm Paolo Bonzini

vnc: add error propagation to vnc_display_open

Before:

$ qemu-system-x86_64 -vnc foo.bar:12345
getaddrinfo(foo.bar,18245): Name or service not known
Failed to start VNC server on `foo.bar:12345'
$ qemu-system-x86_64 -vnc localhost:12345,reverse=on...
3f8b11bc 10/23/2012 02:54 pm Paolo Bonzini

vnc: drop QERR_VNC_SERVER_FAILED

We now always return "nice" error messages in errp when we goto fail.
Drop the default error message.

Signed-off-by: Paolo Bonzini <>

c1c1619c 10/23/2012 02:54 pm Paolo Bonzini

vnc: avoid Yoda conditionals

Signed-off-by: Paolo Bonzini <>

1ce52c78 10/23/2012 02:54 pm Paolo Bonzini

vnc: introduce a single label for error returns

Signed-off-by: Paolo Bonzini <>

007fcd3e 10/23/2012 02:54 pm Paolo Bonzini

vnc: reorganize code for reverse mode

Avoid the dance between csock and vs->lsock.

Signed-off-by: Paolo Bonzini <>

7fc4e63e 10/23/2012 02:54 pm Paolo Bonzini

qemu-sockets: add Error ** to all functions

This lets me adjust the clients to do proper error propagation first,
thus avoiding temporary regressions in the quality of the error messages.

Reviewed-by: Luiz Capitulino <>
Signed-off-by: Paolo Bonzini <>

fe3e7f2d 10/19/2012 11:27 am Joel Martin

ui/vnc: Only report/use TIGHT_PNG encoding if enabled.

If TIGHT_PNG is not enabled by the --enable-vnc-png configure flag
then do not report to the client that it is supported.

Also, since TIGHT_PNG is the same as the TIGHT encoding but with the
filter/copy replaced with PNG data, adding it to the supported...

417b0b88 10/12/2012 11:55 am Paolo Bonzini

vnc: fix "info vnc" with "-vnc ..., reverse=on"

When reverse connection is in use, there is no active VNC server
socket. Because of this, getsockopt(-1, ...) is attempted and
the following error is emitted:

$ socat TCP-LISTEN:5900,reuseaddr TCP-LISTEN:5901,reuseaddr &...
5db5f44c 09/26/2012 03:05 am Orit Wasserman

Separate inet_connect into inet_connect (blocking) and inet_nonblocking_connect

No need to add non blocking parameters to the blocking inet_connect
add block parameter for inet_connect_opts instead of using QemuOpt "block".

Signed-off-by: Orit Wasserman <>...

02a08fef 08/13/2012 07:20 pm Luiz Capitulino

net: inet_connect(), inet_connect_opts(): add in_progress argument

It's used to indicate the special case where a valid file-descriptor
is returned (ie. success) but the connection can't be completed
w/o blocking.

This is needed because QERR_SOCKET_CONNECT_IN_PROGRESS is not...

0f66998f 08/03/2012 10:28 pm Paul Moore

vnc: disable VNC password authentication (security type 2) when in FIPS mode

FIPS 140-2 requires disabling certain ciphers, including DES, which is used
by VNC to obscure passwords when they are sent over the network. The
solution for FIPS users is to disable the use of VNC password auth when the...

0ed8b6f6 07/28/2012 12:23 pm Blue Swirl

Avoid returning void

It's silly and non-conforming to standards to return void,
don't do it.

Signed-off-by: Blue Swirl <>

2624bab8 06/28/2012 12:27 am Daniel P. Berrange

Remove support for non-threaded VNC server

QEMU now has a fundamental requirement for pthreads, so there
is no compelling reason to retain support for the non-threaded
VNC server. Remove the --{enable,disable}-vnc-thread configure
arguments, and all CONFIG_VNC_THREAD conditionals...

1643f2b2 05/30/2012 05:28 am Gerd Hoffmann

vnc: fix segfault in vnc_display_pw_expire()

NULL pointer dereference in case no vnc server is configured.
Catch this and return -EINVAL like vnc_display_password() does.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

a6ba35b3 05/10/2012 08:37 pm Amos Kong

sockets: change inet_connect() to support nonblock socket

Add a bool argument to inet_connect() to assign if set socket
to block/nonblock, and delete original argument 'socktype'
that is unused.
Add a new argument to inet_connect()/inet_connect_opts(),
to pass back connect error by error class....

029409e5 05/10/2012 08:37 pm Amos Kong

sockets: use error class to pass listen error

Add a new argument in inet_listen()/inet_listen_opts()
to pass back listen error.

Change nbd, qemu-char, vnc to use new interface.

Signed-off-by: Amos Kong <>
Reviewed-by: Orit Wasserman <>...

175b2a6e 03/14/2012 11:22 pm Corentin Chary

vnc: don't mess up with iohandlers in the vnc thread

The threaded VNC servers messed up with QEMU fd handlers without
any kind of locking, and that can cause some nasty race conditions.

Using qemu_mutex_lock_iothread() won't work because vnc_dpy_cpy(),
which will wait for the current job queue to finish, can be called with...

9e4dd565 03/14/2012 11:22 pm Stefan Weil

vnc: Limit r/w access to size of allocated memory

This fixes memory reads and writes which exceeded the upper limit
of allocated memory vd->guest.ds->data and vd->server->data.

Cc: Anthony Liguori <>
Signed-off-by: Stefan Weil <>...

1d3323de 03/12/2012 09:05 pm Gerd Hoffmann

implement vnc_dpy_setdata

The comment is wrong, we have to do something in the setdata callback.
Changing the framebuffer backing storage (happens when the guest pans
the display) renders the whole screen content invalid.

Trigger #1: cirrus vga + 32bit linux guest + vesafb with ypan enabled....

7dfbfc79 02/17/2012 05:58 pm Daniel P. Berrange

vnc: Don't demote authentication scheme when changing password/disabling login

Currently when disabling login in VNC, the password is cleared out and the
authentication protocol is forced to AUTH_VNC. If you're using a stronger
authentication protocol, this has the effect of downgrading your security...

ce3e1417 02/10/2012 10:58 am Gerd Hoffmann

Fix vnc memory corruption with width = 1400

vnc assumes that the screen width is a multiple of 16 in several places.
If this is not the case vnc will overrun buffers, corrupt memory, make
qemu crash.

This is the minimum fix for this bug. It makes sure we don't overrun the...

e26437c2 02/10/2012 10:58 am Gerd Hoffmann

vnc: fix ctrl key in vnc terminal emulation

Make the control keys for terminals on the vnc display
(i.e. qemu -vnc :0 -serial vc) work. Makes the terminals
alot more usable as typing Ctrl-C in your serial console
actually has the desired effect ;)

Signed-off-by: Gerd Hoffmann <>

8cf36489 02/10/2012 10:58 am Gerd Hoffmann

vnc: implement shared flag handling.

VNC clients send a shared flag in the client init message. Up to now
qemu completely ignores this. This patch implements shared flag
handling. It comes with three policies: By default qemu behaves as one
would expect: Asking for a exclusive access grants exclusive access to...

7bc9318b 02/10/2012 10:58 am Gerd Hoffmann

vnc: lift modifier keys on client disconnect.

For any modifier key (shift, ctrl, alt) still pressed on disconnect
inject a key-up event into the guest. The vnc client is gone, it will
not do that, so qemu has to do it instead.

Without this keys will get stuck, making the guest act in weird ways...

a6aa9d3e 01/18/2012 02:23 pm Luiz Capitulino

vnc: Simplify vnc_display_password()

Drop the qerror_report() call from it and let its callers set the error
themselves. This also allows for dropping the 'ret' variable.

Signed-off-by: Luiz Capitulino <>

cee8e6ad 01/13/2012 12:36 pm Stefan Hajnoczi

vnc: fix no-lock-key-sync strncmp() length

The no-lock-key-sync option is being parsed incorrectly because of an
outdated strcmp() length value. Use the correct length so that invalid
option names do not match.

Reported-by: Dr David Alan Gilbert <>...

3a93113a 12/06/2011 11:56 am Dong Xu Wang

fix typo: delete redundant semicolon

Double semicolons should be single.

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

e5bed759 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in ui sub directory

Cc: Anthony Liguori <>
Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

ae878b17 11/01/2011 11:52 pm Stefan Weil

ui/vnc: Fix use of free() instead of g_free()

Please note that mechlist still uses malloc / strdup / free.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

2b54aa87 10/27/2011 04:48 pm Luiz Capitulino

qapi: Convert query-vnc

There are three important remarks in relation to the non-qapi command:

1. This commit also fixes the behavior of the 'query-vnc' and 'info vnc'
commands to return an error when qemu is built without VNC support
(ie. --disable-vnc). The non-qapi command would return the OK...
7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

00aa0040 07/25/2011 05:38 pm Blue Swirl

Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
CC slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...

9e8dd451 07/23/2011 07:26 pm Jan Kiszka

notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <>...

7e7e2ebc 07/23/2011 07:19 pm Daniel P. Berrange

Store VNC auth scheme per-client as well as per-server

A future patch will introduce a situation where different
clients may have different authentication schemes set.
When a new client arrives, copy the 'auth' and 'subauth'
fields from VncDisplay into the client's VncState, and...

13661089 07/23/2011 07:19 pm Daniel P. Berrange

Introduce a 'client_add' monitor command accepting an open FD

Allow client connections for VNC and socket based character
devices to be passed in over the monitor using SCM_RIGHTS.

One intended usage scenario is to start QEMU with VNC on a
UNIX domain socket. An unprivileged user which cannot access...

a0843a68 03/22/2011 06:27 pm Anthony Liguori

vnc: fix build error from VNC_DIRTY_WORDS

Signed-off-by: Anthony Liguori <>

821601ea 03/22/2011 03:39 pm Jes Sorensen

Make VNC support optional

Per default VNC is enabled.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Anthony Liguori <>

6ed391bf 03/22/2011 03:39 pm Wen Congyang

fix vnc regression

This patch fix the following regression:
1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits().

Signed-off-by: Wen Congyang <>
Signed-off-by: Anthony Liguori <>

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

This was done with:

sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \
$(git grep -l 'get_clock\>.*rt_clock' )
sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
ad620c29 03/15/2011 10:49 pm Blue Swirl

win32: implement missing timersub

Implement and wrap timersub() for Win32.

Acked-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

23bfe28f 03/11/2011 12:12 am Stefan Weil

vnc: Fix stack corruption and other bitmap related bugs

Commit bc2429b9174ac2d3c56b7fd35884b0d89ec7fb02 introduced
a severe bug (stack corruption).

bitmap_clear was called with a wrong argument
which caused out-of-bound writes to the local variable width_mask....

207f328a 02/24/2011 12:28 am Corentin Chary

vnc: fix lossy rect refreshing

The for loop in send_lossy_rect was totally wrong, and we can't
call vnc_set_bits() because it does not really do what it should.
Use vnc_set_bit() directly instead.

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

bc2429b9 02/24/2011 12:28 am Corentin Chary

vnc: use the new generic bitmap functions

Switch to bitmap.h and bitops.h instead of redefining our own bitmap
helpers.

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

6c71a539 02/24/2011 12:28 am Corentin Chary

vnc: don't try to send bigger updates that client height

Respect client size if it doesn't not support desktop resizing.

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

80e0c8c3 02/24/2011 12:28 am Corentin Chary

vnc: add a non-adaptive option

This option allow to disable adaptive behaviors in some encodings.

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

5db8378a 02/24/2011 12:28 am Stefan Weil

vnc: Fix fatal crash with vnc reverse mode

Reverse mode is unusable:

qemu -vnc localhost:5500,reverse

crashes in vnc_refresh_server_surface because some pointers are NULL.

Fix this by calling vnc_dpy_resize (which initializes these pointers)
before calling vnc_refresh....

b31f519e 02/24/2011 12:28 am Corentin Chary

vnc: don't set the quality if lossy encoding are disabled

This should not change the current behavior, but if any new
encoding try to use the tight quality, it will always be set
to -1 when lossy encodings are disabled.

Signed-off-by: Corentin Chary <>...

999342a0 02/24/2011 12:28 am Corentin Chary

vnc: add a way to get the update frequency for a given region

This patch compute the update frequency (in Hz) for each 64x64 rects.
Any adaptive encoding can get this value using vnc_update_freq(), and
switch to a lossy encoding if the value is too high....

7d964c9d 02/24/2011 12:28 am Corentin Chary

vnc: refresh lossy rect after a given timeout

If an adaptive encoding has choosen to send a lossy update
based on the result of vnc_update_freq(), then it should advertise
it with vnc_sent_lossy_rect(). This will allow to automatically refresh
this rect once it's static again....

148954fa 02/24/2011 12:28 am Corentin Chary

vnc: Add ZRLE and ZYWRLE encodings.

Add ZRLE [1] and ZYWRLE [2] encodings. The code is inspire^W stolen
from libvncserver (again), but have been rewriten to match QEMU coding
style.

[1] http://www.realvnc.com/docs/rfbproto.pdf
[2] http://micro-vnc.jp/research/remote_desktop_ng/ZYWRLE/publications/...

cfb41c82 02/01/2011 11:21 pm Anthony Liguori

Merge remote branch 'spice/usb.5' into staging

1cd20f8b 02/01/2011 11:16 pm Anthony Liguori

vnc: Fix password expiration through 'change vnc ""' (v2)

commit 52c18be9e99dabe295321153fda7fce9f76647ac introduced a regression in the
change vnc password command that changed the behavior of setting the VNC
password to an empty string from disabling login to disabling authentication....

9892088b 01/24/2011 06:21 pm Gerd Hoffmann

vnc: fix numlock+capslock tracking

This patch makes the numlock+capslock tracking logic only look at
keydown events. Without this patch the vnc server will insert
bogous capslock keypress in case it sees the following key sequence:

shift down --- 'A' down --- shift up  --- 'A' up...
6bffdf0f 12/09/2010 03:23 pm Gerd Hoffmann

vnc: auth reject cleanup

protocol_client_auth_vnc() has two places where the auth can fail,
with identical code sending the reject message to the client.
Move the common code to the end of the function and make both
error paths jump there. No functional change....

3c9405a0 12/09/2010 03:23 pm Gerd Hoffmann

vnc: support password expire

This patch adds support for expiring passwords to vnc. It adds a new
vnc_display_pw_expire() function which specifies the time when the
password will expire.

Signed-off-by: Gerd Hoffmann <>

2ded6ad7 10/13/2010 09:43 pm Blue Swirl

vnc: avoid write only variables

Compiling with GCC 4.6.0 20100925 produced warnings:
/src/qemu/ui/vnc.c: In function 'vnc_client_cache_auth':
/src/qemu/ui/vnc.c:217:12: error: variable 'qdict' set but not used [-Werror=unused-but-set-variable]
/src/qemu/ui/vnc.c: In function 'vnc_display_open':...

ac71103d 08/23/2010 12:48 am Yoshiaki Tamura

vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()

Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SET
in main_loop_wait().

Signed-off-by: Yoshiaki Tamura <>
Signed-off-by: Anthony Liguori <>

efe556ad 07/27/2010 01:36 am Corentin Chary

vnc: tight add PNG encoding

Introduce a new encoding: VNC_ENCODING_TIGHT_PNG [1] (-269) with a new
tight filter VNC_TIGHT_PNG (0x0A). When the client tells it supports the Tight PNG
encoding, the server will use tight, but will always send encoding pixels using...

d1af0e05 07/27/2010 01:36 am Corentin Chary

vnc: encapsulate encoding members

This will allow to implement the threaded VNC server in a
more cleaner way.

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

bd023f95 07/27/2010 01:36 am Corentin Chary

vnc: threaded VNC server

Implement a threaded VNC server using the producer-consumer model.
The main thread will push encoding jobs (a list a rectangles to update)
in a queue, and the VNC worker thread will consume that queue and send
framebuffer updates to the output buffer....

d01f9595 07/27/2010 01:36 am Corentin Chary

vnc: add missing lock for vnc_cursor_define()

All vnc_write() calls must be locked (except the ones present before
the protocol initialization).

Signed-off-by: Corentin Chary <>
Signed-off-by: Anthony Liguori <>

3e230dd2 07/27/2010 01:35 am Corentin Chary

ui: move all ui components in ui/

Move sdl, vnc, curses and cocoa UI into ui/ to cleanup
the root directory. Also remove some unnecessary explicit
targets from Makefile.

aliguori: fix build when srcdir != objdir

Signed-off-by: Corentin Chary <>...