summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
* vnc: Fix stack corruption and other bitmap related bugsStefan Weil2011-03-102-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. This bug was detected with QEMU running on windows. It also occurs with wine: *** stack smashing detected ***: terminated wine: Unhandled illegal instruction at address 0x6115c7 (thread 0009), starting debugger... The bug is not windows specific! Instead of fixing the wrong parameter value, bitmap_clear(), bitmap_set and width_mask were removed, and bitmap_intersect() was replaced by !bitmap_empty(). The new operation is much shorter and equivalent to the old operations. The declarations of the dirty bitmaps in vnc.h were also wrong for 64 bit hosts because of a rounding effect: for these hosts, VNC_MAX_WIDTH is no longer a multiple of (16 * BITS_PER_LONG), so the rounded value of VNC_DIRTY_WORDS was too small. Fix both declarations by using the macro which is designed for this purpose. Cc: Corentin Chary <corentincj@iksaif.net> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Gerhard Wiesinger <lists@wiesinger.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: fix a memory leak in threaded vnc serverCorentin Chary2011-02-251-0/+2
| | | | | | | | | | | | | | VncJobQueue's buffer is intended to be used for as the output buffer for all operations in this queue, but unfortunatly. vnc_async_encoding_start() is in charge of setting this buffer as the current output buffer, but vnc_async_encoding_end() was not writting the changes back to VncJobQueue, resulting in a big and ugly memleak. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not definedPeter Maydell2011-02-241-0/+4
| | | | | | | | Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEG case introduced by commit ce702e93. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: Fix fatal crash with vnc reverse modeStefan Weil2011-02-231-0/+1
| | | | | | | | | | | | | | | 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. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: add a non-adaptive optionCorentin Chary2011-02-233-5/+11
| | | | | | | This option allow to disable adaptive behaviors in some encodings. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: tight: tweak adaptive tight settingsCorentin Chary2011-02-231-10/+10
| | | | | | | The force_jpeg threshold was too low. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: don't try to send bigger updates that client heightCorentin Chary2011-02-231-5/+5
| | | | | | | Respect client size if it doesn't not support desktop resizing. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: use the new generic bitmap functionsCorentin Chary2011-02-232-73/+25
| | | | | | | | Switch to bitmap.h and bitops.h instead of redefining our own bitmap helpers. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: fix lossy rect refreshingCorentin Chary2011-02-231-4/+8
| | | | | | | | | 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 <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: fix uint8_t comparisons with negative valuesCorentin Chary2011-02-232-3/+4
| | | | | Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: Add ZRLE and ZYWRLE encodings.Corentin Chary2011-02-238-1/+1540
| | | | | | | | | | | | 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/ Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: palette: and fill and color calls.Corentin Chary2011-02-232-0/+35
| | | | | | | These two helpers are needed for zrle and zywrle. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: palette: add palette_init callsCorentin Chary2011-02-232-1/+8
| | | | | | | | This allow to use palette on the stack instead of always allocating them. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: palette: use a pool to reduce memory allocationsCorentin Chary2011-02-232-17/+4
| | | | | | | | We now that the palette will never have more than 256 elements. Let's use a pool to reduce malloc calls. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: tight: use the update frequency to choose between lossy and losslessCorentin Chary2011-02-231-13/+62
| | | | | | | | Use the new update frequency infrastructure to use jpeg for regions with high update frequency. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: refresh lossy rect after a given timeoutCorentin Chary2011-02-233-3/+69
| | | | | | | | | | 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. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: add a way to get the update frequency for a given regionCorentin Chary2011-02-232-0/+120
| | | | | | | | | | | | | | | 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. The frequency is pre-calculated every 500ms, based on the last 10 updates per 64x64 rect. If a 64x64 rect was not updated in the last 2 second, then the frequency became 0, and all the stored timestamp are reseted. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: don't set the quality if lossy encoding are disabledCorentin Chary2011-02-231-1/+3
| | | | | | | | | 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 <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: qemu can die if the client is disconnected while updating screenCorentin Chary2011-02-041-0/+4
| | | | | | | | | | | | agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing in vnc_disconnect_finish(). It's because vnc_worker_thread_loop() tries to unlock the mutex while not locked. The unlocking call doesn't fail (pthread bug ?), but the destroy call does. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ui/sdl: Fix handling of caps lock and num lock keysStefan Weil2011-02-041-0/+8
| | | | | | | | | | | | | | | | | | | | Starting with SDL version 1.2.14, caps lock and num lock keys will send a SDL_KEYUP when SDL_DISABLE_LOCK_KEYS=1 is set in the environment. The new code sets the environment unconditionally (it won't harm old versions which do not know it). The workaround for SDL_KEYUP is only compiled with old SDL versions. A similar patch without handling of old SDL versions was already published by Benjamin Drung for Ubuntu. Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Benjamin Drung <benjamin.drung@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'spice/spice.v29.pull' into stagingAnthony Liguori2011-02-012-0/+32
|\ | | | | | | | | Conflicts: trace-events
| * spice: add chardev (v5)Alon Levy2011-01-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a chardev backend for spice, where spice determines what to do with it based on the name attribute given during chardev creation. For usage by spice vdagent in conjunction with a properly named virtio-serial device, and future smartcard channel usage. Example usage: qemu -device virtio-serial -chardev spicevmc,name=vdagent,id=vdagent \ -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 v4->v5: * add tracing events * fix missing comma * fix help string to show debug is optional v3->v4: * updated commit message v1->v3 changes: (v2 had a wrong commit message) * removed spice-qemu-char.h, folded into ui/qemu-spice.h * removed dead IOCTL code * removed comment * removed ifdef CONFIG_SPICE from qemu-config.c and qemu-options.hx help. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice/vnc: client migration.Gerd Hoffmann2011-01-242-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | Handle spice client migration, i.e. inform a spice client connected about the new host and connection parameters, so it can move over the connection automatically. The monitor command has a not-yet used protocol argument simliar to set_password and expire_password commands. This allows to add a simliar feature to vnc in the future. Daniel Berrange plans to work on this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote branch 'spice/usb.5' into stagingAnthony Liguori2011-02-011-2/+2
|\ \
| * | vnc: fix numlock+capslock trackingGerd Hoffmann2011-01-241-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ^ here It doesn't hurt with a PS/2 keyboard, but it disturbs the USB Keyboard. And with the key event queue just added to the usb keyboard the guest will actually notice. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | vnc: Fix password expiration through 'change vnc ""' (v2)Anthony Liguori2011-02-011-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. This commit refactors the code to eliminate this overloaded semantics in vnc_display_password and instead introduces the vnc_display_disable_login. The monitor implementation then determines the behavior of an empty or missing string. Recently, a set_password command was added that allows both the Spice and VNC password to be set. This command has not shown up in a release yet so the behavior is not yet defined. This patch proposes that an empty password be treated as an empty password with no special handling. For specifically disabling login, I believe a new command should be introduced instead of overloading semantics. I'm not sure how Spice handles this but I would recommend that we have Spice and VNC have consistent semantics here for the 0.14.0 release. Reported-by: Neil Wilson <neil@aldur.co.uk> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - Add a proper return to make sure that login is really disabled instead of relying on the VNC server to treat empty passwords specially
* | sdl: remove unused variableBlue Swirl2011-01-291-6/+0
|/ | | | | | | | | Variable rec is not used, remove it. Spotted by GCC 4.6.0: CC ui/sdl.o /src/qemu/ui/sdl.c: In function 'sdl_setdata': /src/qemu/ui/sdl.c:90:14: error: variable 'rec' set but not used [-Werror=unused-but-set-variable] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Delete useless 'extern' qualifiers for functionsBlue Swirl2011-01-233-9/+9
| | | | | | | 'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vnc-auth-sasl: fix a memory leakBlue Swirl2011-01-121-6/+8
| | | | | | | Fix a memory leak reported by cppcheck: [/src/qemu/ui/vnc-auth-sasl.c:448]: (error) Memory leak: mechname Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vnc/spice: add set_passwd monitor command.Gerd Hoffmann2010-12-092-0/+40
| | | | | | | | This patch adds new set_password and expire_password monitor commands which allows to change and expire the password for spice and vnc connections. See the doc update patch chunk for details. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vnc: support password expireGerd Hoffmann2010-12-092-0/+15
| | | | | | | | 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 <kraxel@redhat.com>
* vnc: auth reject cleanupGerd Hoffmann2010-12-091-17/+13
| | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: add qmp 'query-spice' and hmp 'info spice' commands.Gerd Hoffmann2010-12-092-0/+139
| | | | | | | | The patch adds a 'query-spice' monitor command which returns informations about the spice server configuration and also a list of channel connections. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: connection events.Gerd Hoffmann2010-12-091-0/+75
| | | | | | | | | | This patch adds support for connection events to spice. The events are quite simliar to the vnc events. Unlike vnc spice uses multiple tcp channels though. qemu will report every single tcp connection (aka spice channel). If you want track spice sessions only you can filter for the main channel (channel-type == 1). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: add qxl deviceGerd Hoffmann2010-12-091-0/+15
| | | | | | | | | | | | | | | | | | | | qxl is a paravirtual graphics card. The qxl device is the bridge between the guest and the spice server (aka libspice-server). The spice server will send the rendering commands to the spice client, which will actually render them. The spice server is also able to render locally, which is done in case the guest wants read something from video memory. Local rendering is also used to support display over vnc and sdl. qxl is activated using "-vga qxl". qxl supports multihead, additional cards can be added via '-device qxl". [ v2: add copyright to files ] [ v2: use qemu-common.h for standard includes ] [ v2: create separate qxl-vga device for primary ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote branch 'spice/bugfix.2' into stagingAnthony Liguori2010-11-163-17/+17
|\
| * spice-display: replace private lock with qemu mutex.Gerd Hoffmann2010-11-022-14/+14
| | | | | | | | | | | | | | | | | | | | | | qemu_spice_create_update() must aquire the global qemu mutex to make sure DisplayState doesn't change while we are accessing it. Once this is in place the private lock is pretty pointless as everything it protects is covered by the global qemu mutex now. Drop it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice-core: fix warning when building with spice < 0.6.0Gerd Hoffmann2010-11-021-2/+2
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * spice-core: fix watching for write eventsHans de Goede2010-11-021-1/+1
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: add audioGerd Hoffmann2010-11-092-0/+2
|/ | | | | | | | | | | | | | | | | | | Add support for the spice audio interface. With this patch applied audio can be forwarded over the network from/to the spice client. Both recording and playback is supported. The driver is first in the driver list, but the can_be_default flag is set only in case spice is active. So if you have the spice protocol enabled the spice audio driver is the default one, otherwise whatever comes first after spice in the list. Overriding the default using QEMU_AUDIO_DRV works in any case. [ v2: audio codestyle: add spaces before open parenthesis ] [ v2: add const to silence array ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Cc: malc <av1474@comtv.ru> Signed-off-by: malc <av1474@comtv.ru>
* Merge remote branch 'spice/config.2' into stagingAnthony Liguori2010-11-011-6/+202
|\
| * spice: add misc config optionsGerd Hoffmann2010-10-081-1/+28
| | | | | | | | | | This patch adds a few more options to tweak spice server behavior. The documentation update chunk has the details ;)
| * spice: add config options for the listening addressGerd Hoffmann2010-10-081-2/+11
| | | | | | | | | | Make listening address configurable. Also add options to force using IPv4 or IPv6.
| * spice: add config options for channel security.Gerd Hoffmann2010-10-081-0/+28
| | | | | | | | | | | | | | This allows to enforce tls or plaintext usage for certain spice channels. [ v2: code style fixup ]
| * spice: make compression configurable.Yonit Halperin2010-10-081-2/+75
| | | | | | | | | | | | | | This patch adds options to the -spice command line switch to configure image compression. [ v2: speling fix in the documentation ]
| * spice: tls supportGerd Hoffmann2010-10-081-4/+63
| | | | | | | | Add options to the -spice command line switch to setup tls.
* | Replace remaining gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace the remaining format attribute printf by macro GCC_FMT_ATTR which uses gnu_printf (if supported). v2 * Removal of dyngen specific code is now done in a separate patch. * Handle attribute in new ui/spice-display.c, too. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | curses: Fix control-{@[\]^_} and ESCSamuel Thibault2010-10-212-3/+7
| | | | | | | | | | | | | | | | control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correct translation. ESC is better simulated as escape key. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
* | vnc: avoid write only variablesBlue Swirl2010-10-131-0/+8
|/ | | | | | | | | | | | | 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': /src/qemu/ui/vnc.c:2526:9: error: variable 'acl' set but not used [-Werror=unused-but-set-variable] Fix by making the variable declarations and their uses also conditional to debug definition. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote branch 'spice/submit.6' into stagingAnthony Liguori2010-10-055-0/+928
|\ | | | | | | | | | | | | Conflicts: configure Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud