summaryrefslogtreecommitdiff
path: root/ui
AgeCommit message (Collapse)AuthorFilesLines
2011-06-08Merge remote-tracking branch 'spice/spice.v37' into stagingAnthony Liguori1-8/+18
Conflicts: vl.c
2011-06-08Fix compilation warning due to missing header for sigaction (followup)Alexandre Raymond2-5/+0
This patch removes all references to signal.h when qemu-common.h is included as they become redundant. Signed-off-by: Alexandre Raymond <cerbere@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-06spice: require spice 0.6.0 or newer.Gerd Hoffmann1-8/+0
This patch raises the minimum required spice version to 0.6.0 and drops a few ifdefs. 0.6.0 is the first stable release with the current libspice-server API, there shouldn't be any 0.5.x development versions deployed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add SASL supportMarc-André Lureau1-0/+12
Turn on SASL support by appending "sasl" to the spice arguments, which requires that the client use SASL to authenticate with the spice. The exact choice of authentication method used is controlled from the system / user's SASL configuration file for the 'qemu' service. This is typically found in /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user, an environment variable SASL_CONF_PATH can be used to make it search alternate locations for the service config. While some SASL auth methods can also provide data encryption (eg GSSAPI), it is recommended that SASL always be combined with the 'tls' and 'x509' settings to enable use of SSL and server certificates. This ensures a data encryption preventing compromise of authentication credentials. It requires support from spice 0.8.1. [ kraxel: moved spell fix to separate commit ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-06spice: add option for disabling copy paste supportHans de Goede1-0/+6
Some people want to be able disable spice's guest <-> client copy paste support because of security considerations. [ kraxel: drop old-version error message ]
2011-05-15set $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for ↵Michael Tokarev1-0/+12
video card Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-05-03spice: drop obsolete iothread lockingGerd Hoffmann1-6/+0
We don't use qemu internals from spice server context any more. Thus we don't also need to grab the iothread mutex from spice server context. And we don't have to temporarely release the lock to avoid deadlocks. Drop all the calls. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03spice: don't call displaystate callbacks from spice server context.Gerd Hoffmann2-0/+15
This patch moves the displaystate callback calls for setting the cursor and the mouse pointer from spice server to qemu (iothread) context. This allows us to simplify locking. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03spice: don't create updates in spice server context.Gerd Hoffmann2-21/+43
This patch moves the creation of spice screen updates from the spice server context to qemu iothread context (display refresh timer to be exact). This way we avoid accessing qemu internals (display surface) from spice thread context which in turn allows us to simplify locking. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-05-03Make spice dummy functions inline to fix calls not checking return valuesJes Sorensen1-2/+10
qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functions needs to be inline, in order to handle the case where they are called without checking the return value. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-04-10vnc: tight: Fix crash after 2GB of outputMichael Tokarev2-4/+5
fix 2Gb integer overflow in in VNC tight and zlib encodings As found by Roland Dreier <roland@purestorage.com> (excellent catch!), when amount of VNC compressed data produced by zlib and sent to client exceeds 2Gb, integer overflow occurs because currently, we calculate amount of data produced at each step by comparing saved total_out with new total_out, and total_out is something which grows without bounds. Compare it with previous avail_out instead of total_out, and leave total_out alone. The same code is used in vnc-enc-tight.c and vnc-enc-zlib.c, so fix both cases. There, there's no actual need to save previous_out value, since capacity-offset (which is how that value is calculated) stays the same so it can be recalculated again after call to deflate(), but whole thing becomes less readable this way. Reported-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01vnc: added missing name->keysym pairs for Polish national charactersLeszek Grzegorek1-0/+18
There are no { name, keysym } values in name2keysym[] array for Polish national characters so "-k pl" option has no effect. Signed-off-by: Leszek Grzegorek <leszek.grzegorek@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-04-01ui/sdl: Load optional QEMU iconStefan Weil1-0/+13
Load an optional QEMU icon file. If there is no icon file named qemu.bmp in QEMU's default search path, QEMU will run with the usual system default icon. A matching icon file will be loaded and used by X Windows managers or MS Windows while a QEMU instance is running. SDL requires icon files in 32x32x4 bmp format. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-25severe memory leak caused by broken palette_destroy() functionUlrich Obergfell1-3/+1
The following commit breaks the code of the function palette_destroy(). http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268 The broken code causes a severe memory leak of 'VncPalette' structures because it never frees anything: 70 void palette_destroy(VncPalette *palette) 71 { 72 if (palette == NULL) { 73 qemu_free(palette); 74 } 75 } Version 2 of the patch calls qemu_free() unconditionally. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22vnc: fix build error from VNC_DIRTY_WORDSAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22fix vnc regressionWen Congyang1-2/+6
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 <wency@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22Make VNC support optionalJes Sorensen1-4/+10
Per default VNC is enabled. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22Consolidate DisplaySurface allocation in qemu_alloc_display()Jes Sorensen1-12/+8
This removes various code duplication from console.e and sdl.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-21change all rt_clock references to use millisecond resolution accessorsPaolo Bonzini2-7/+7
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/' \ $(git grep -l 'new_timer\>.*rt_clock' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-03-15win32: implement missing timersubBlue Swirl1-3/+3
Implement and wrap timersub() for Win32. Acked-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-13Refactor thread retrieval and checkJan Kiszka1-1/+1
We have qemu_cpu_self and qemu_thread_self. The latter is retrieving the current thread, the former is checking for equality (using CPUState). We also have qemu_thread_equal which is only used like qemu_cpu_self. This refactors the interfaces, creating qemu_cpu_is_self and qemu_thread_is_self as well ass qemu_thread_get_self. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-10vnc: Fix stack corruption and other bitmap related bugsStefan Weil2-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>
2011-02-25vnc: fix a memory leak in threaded vnc serverCorentin Chary1-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>
2011-02-24ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not definedPeter Maydell1-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>
2011-02-23vnc: Fix fatal crash with vnc reverse modeStefan Weil1-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>
2011-02-23vnc: add a non-adaptive optionCorentin Chary3-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>
2011-02-23vnc: tight: tweak adaptive tight settingsCorentin Chary1-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>
2011-02-23vnc: don't try to send bigger updates that client heightCorentin Chary1-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>
2011-02-23vnc: use the new generic bitmap functionsCorentin Chary2-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>
2011-02-23vnc: fix lossy rect refreshingCorentin Chary1-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>
2011-02-23vnc: fix uint8_t comparisons with negative valuesCorentin Chary2-3/+4
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-23vnc: Add ZRLE and ZYWRLE encodings.Corentin Chary8-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>
2011-02-23vnc: palette: and fill and color calls.Corentin Chary2-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>
2011-02-23vnc: palette: add palette_init callsCorentin Chary2-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>
2011-02-23vnc: palette: use a pool to reduce memory allocationsCorentin Chary2-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>
2011-02-23vnc: tight: use the update frequency to choose between lossy and losslessCorentin Chary1-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>
2011-02-23vnc: refresh lossy rect after a given timeoutCorentin Chary3-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>
2011-02-23vnc: add a way to get the update frequency for a given regionCorentin Chary2-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>
2011-02-23vnc: don't set the quality if lossy encoding are disabledCorentin Chary1-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>
2011-02-04vnc: qemu can die if the client is disconnected while updating screenCorentin Chary1-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>
2011-02-04ui/sdl: Fix handling of caps lock and num lock keysStefan Weil1-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>
2011-02-01Merge remote branch 'spice/spice.v29.pull' into stagingAnthony Liguori2-0/+32
Conflicts: trace-events
2011-02-01Merge remote branch 'spice/usb.5' into stagingAnthony Liguori1-2/+2
2011-02-01vnc: Fix password expiration through 'change vnc ""' (v2)Anthony Liguori1-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
2011-01-29sdl: remove unused variableBlue Swirl1-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>
2011-01-24vnc: fix numlock+capslock trackingGerd Hoffmann1-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>
2011-01-24spice: add chardev (v5)Alon Levy1-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>
2011-01-24spice/vnc: client migration.Gerd Hoffmann2-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>
2011-01-23Delete useless 'extern' qualifiers for functionsBlue Swirl3-9/+9
'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-12vnc-auth-sasl: fix a memory leakBlue Swirl1-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>