summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'kraxel/vnc.2' into stagingAnthony Liguori2012-02-152-3/+148
|\ | | | | | | | | | | | | | | * kraxel/vnc.2: vnc: lift modifier keys on client disconnect. vnc: implement shared flag handling. vnc: fix ctrl key in vnc terminal emulation Fix vnc memory corruption with width = 1400
| * vnc: lift modifier keys on client disconnect.Gerd Hoffmann2012-02-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 after reconnecting. Reproducer: exit vnc client via Alt-F4, guest continues to see the pressed alt key and will not react to key events in any useful way until you tap the alt key once to unstuck it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * vnc: implement shared flag handling.Gerd Hoffmann2012-02-102-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 the client connecting. There is also a desktop sharing mode which disallows exclusive connects (so one forgetting -shared wouldn't drop everybody else) and a compatibility mode which mimics the traditional (but non-conforming) qemu behavior. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * vnc: fix ctrl key in vnc terminal emulationGerd Hoffmann2012-02-101-2/+8
| | | | | | | | | | | | | | | | | | 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 <kraxel@redhat.com>
| * Fix vnc memory corruption with width = 1400Gerd Hoffmann2012-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 scanline, thereby fixing the segfault. The rendering is *not* correct though, there is a black border at the right side of the screen, 8 pixels wide because 1400 % 16 == 8. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | qom: Unify type registrationAndreas Färber2012-02-151-2/+3
|/ | | | | | | | | | | | | Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Limit sdl_grab_end in handle_activation to Windows hostsJan Kiszka2012-02-011-0/+4
| | | | | | | | | | | | | | There are scenarios on Linux with some SDL versions where handle_activation is continuous invoked with state = SDL_APPINPUTFOCUS and gain = 0 while we grabbed the input. This causes a ping-pong when we grab the input after an absolute mouse entered the window. As this sdl_grab_end was once introduced to work around a Windows-only issue (0294ffb9c8), limit it to that platform. CC: Erik Rull <erik.rull@rdsoftware.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Grab input on end of non-absolute mouse clickJan Kiszka2012-02-011-2/+1
| | | | | | | | | | | By grabbing the input already on button down, we leave the button in that state for the host GUI. Thus it takes another click after releasing the input again to synchronize the mouse button state. Avoid this by grabbing on button up. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Handle SDL grabs failing (Mark McLoughlin)"Jan Kiszka2012-02-011-6/+3
| | | | | | | | | | | | | | | | This reverts commit 6bb816031f8bc0aafc3476e6dfa4293ee3a5f106. SDL_WM_GrabInput does not reliably bail out if grabbing is impossible. So if we get here, we already lost and will block. But this can no longer happen due to the check in sdl_grab_start. So this patch became obsolete. Conflicts: sdl.c Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Fix block prevention of SDL_WM_GrabInputJan Kiszka2012-02-011-12/+14
| | | | | | | | | Consistently check for SDL_APPINPUTFOCUS before trying to grab the input focus. Just checking for SDL_APPACTIVE doesn't work. Moving the check to sdl_grab_start allows for some consolidation. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Do not grab mouse on mode switch while in backgroundJan Kiszka2012-02-011-14/+16
| | | | | | | | | When the mouse mode changes to absolute while the SDL windows is not in focus, refrain from grabbing the input. It would steal from some other window. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vnc: Simplify vnc_display_password()Luiz Capitulino2012-01-181-10/+4
| | | | | | | 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 <lcapitulino@redhat.com>
* vnc: fix no-lock-key-sync strncmp() lengthStefan Hajnoczi2012-01-131-1/+1
| | | | | | | | | 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 <davidagilbert@uk.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Merge remote-tracking branch 'stefanha/trivial-patches-next' into stagingAnthony Liguori2011-12-143-3/+3
|\
| * Fix spelling in comments, documentation and messagesStefan Weil2011-12-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * fix typo: delete redundant semicolonDong Xu Wang2011-12-061-1/+1
| | | | | | | | | | | | | | Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | qemu-thread: add API for joinable threadsJan Kiszka2011-12-121-1/+1
|/ | | | | | | | | | Split from Jan's original qemu-thread-posix.c patch. No semantic change, just introduce the new API that POSIX and Win32 implementations will conform to. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix spelling in ui sub directoryDong Xu Wang2011-12-021-2/+2
| | | | | | Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* ui: Plug memory leaks on parse_keyboard_layout() error pathMarkus Armbruster2011-11-111-5/+7
| | | | | | | Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ui/vnc: Convert sasl.mechlist to g_malloc() & friendsMarkus Armbruster2011-11-101-14/+5
| | | | | | | | Fixes protocol_client_auth_sasl_mechname() not to crash when malloc() fails. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Merge remote-tracking branch 'afaerber/cocoa-for-upstream' into stagingAnthony Liguori2011-11-011-0/+2
|\
| * cocoa: Close sheet after image file selectionAndreas Färber2011-11-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | If no disk image is specified, the Cocoa frontend displays a modal sheet to let the user select an image file to boot from. This sheet is never closed and it permanently obscures the emulator window. Close it after obtaining the file name in case the user did select a file. Otherwise we exit immediately, so no need to close then. Signed-off-by: Juan Pineda <juan@logician.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
* | ui/vnc: Fix use of free() instead of g_free()Stefan Weil2011-11-014-11/+11
|/ | | | | | | Please note that mechlist still uses malloc / strdup / free. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-10-312-133/+141
|\ | | | | | | | | Conflicts: ui/spice-core.c
| * qapi: Convert query-spiceLuiz Capitulino2011-10-271-81/+58
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-vncLuiz Capitulino2011-10-271-52/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 response in QMP and no response in HMP 2. The qapi version explicitly marks the fields 'host', 'family', 'service' and 'auth' as optional. Their are not documented as optional in the non-qapi command doc, but they would not be returned if vnc support is disabled. The qapi version maintains the same semantics, but documents those fields correctly 3. The 'clients' field, which is a list, is marked as optional but is always returned. If there are no clients connected an empty list is returned. This is not the Right Way to this in the qapi but it's how the non-qapi command used to work Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | spice: fix file handle cleanupGerd Hoffmann2011-10-251-1/+1
| | | | | | | | | | | | | | | | Setting both read and write handlers to NULL in qemu_set_fd_handler is not enougth to make qemu purge the file handle from the list. We must set opaque to NULL too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | ui/spice-core: fix segfault in monitorAlon Levy2011-10-251-1/+1
| | | | | | | | | | | | | | | | | | Fix segfault if a qxl device is present but no spice command line argument is given. RHBZ 743251. Signed-off-by: Alon Levy <alevy@redhat.com>
* | spice: Convert core to QEMU thread APIJan Kiszka2011-10-251-4/+4
| | | | | | | | | | | | | | | | No need to use pthread directly, we have proper abstractions for identity checking. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: support the new migration interface (spice 0.8.3)Yonit Halperin2011-10-251-1/+55
| | | | | | | | | | | | | | | | - call spice_server_migrate_(start|end|connect). - register spice_migrate_connect completion callback Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: turn client_migrate_info to asyncYonit Halperin2011-10-252-6/+18
|/ | | | | | | | | | | | RHBZ 737921 Spice client is required to connect to the migration target before/as migration starts. Since after migration starts, the target qemu is blocked and cannot accept new spice client we trigger the connection to the target upon client_migrate_info command. client_migrate_info completion cb will be called after spice client has been connected to the target (or a timeout). See following patches and spice patches. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* migration: Export a function that tells if the migration has finished correctlyJuan Quintela2011-10-201-2/+2
| | | | | | This will allow us to hide the state values. Signed-off-by: Juan Quintela <quintela@redhat.com>
* use qemu_* ctype functionsChristoph Egger2011-09-211-1/+1
| | | | | | | Fix "warning: array subscript has type 'char'" on NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Drop unneeded pthread.h inclusionsJan Kiszka2011-09-211-2/+0
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Drop the vm_running global variableLuiz Capitulino2011-09-151-3/+3
| | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-152-2/+5
| | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* vns/tls: don't use depricated gnutls functionsGerd Hoffmann2011-09-091-19/+49
| | | | | | | | | | | Avoid using deprecated gnutls functions with recent gnutls versions. Fixes build failure on Fedora 16. Keep the old way for compatibility with old installations such as RHEL-5 (gnutls 1.4.x). Based on a patch from Raghavendra D Prabhu <raghu.prabhu13@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* spice: workaround a spice server bug.Gerd Hoffmann2011-09-071-1/+24
| | | | | spice server might call the channel_event callback from spice server thread context. Detect that and aquire iothread lock if needed,
* spice: set qxl->ssd.running=true before telling spice to start, RHBZ #733993Yonit Halperin2011-09-071-1/+2
| | | | | | | | | If qxl->ssd.running=true is set after telling spice to start, the spice server thread can call qxl_send_events while qxl->ssd.running is still false. This leads to assert(d->ssd.running). Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl: Don't release input on mouse mode change in full-screen modeJan Kiszka2011-08-221-1/+3
| | | | | | | | | While in full-screen mode, the input focus naturally belongs to the SDL window. Avoid dropping it when switching from absolute to relative mouse mode. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Convert last qemu_free and qemu_malloc usesBlue Swirl2011-08-211-3/+3
| | | | | | | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c missed a few cases, fix them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-2014-93/+93
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ui/spice-core: report compiled-version in info spice/query-spiceAlon Levy2011-08-101-0/+8
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* sdl: Refactor sdl_send_mouse_eventJan Kiszka2011-08-051-11/+11
| | | | | | | | Replace width/height globals with the identical values from real_screen, refactor the function according to our coding style. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Factor out event handlers from sdl_refreshJan Kiszka2011-08-051-205/+271
| | | | | | | No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Add zoom hot keysJan Kiszka2011-08-051-0/+13
| | | | | | | | | | Allow to enlarge or shrink the screen via CTRL-ALT-+/-. In contrast to scaling the window, these controls always preserve the aspect ratio of the current console. CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Dynamically grab input in absolute mouse modeJan Kiszka2011-08-051-6/+37
| | | | | | | | | | | | Not grabbing the input means that special keys like ALT+TAB are still handled by the host. Improve the usability by grabbing input once the mouse is inside the guest screen, provided the SDL window has the input focus. Release it again when the mouse is moved to any border. Also grab the input when we gain the input focus and the mouse is within the screen limits. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Fix cursor handling when switching consoles in absolute mouse modeJan Kiszka2011-08-051-3/+10
| | | | | | | | Restore the cursor when switching from graphic to text console while the mouse is in absolute mode. Disable it again when returning. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Never release input while in full screen modeJan Kiszka2011-08-051-3/+4
| | | | | | | | It's confusing to suddenly find two mice in full screen mode when switching consoles or accidentally hitting the grab hot keys. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Consistently avoid grabbing input for text consolesJan Kiszka2011-08-051-3/+6
| | | | | | | | | There were some preexisting bits that released the input when switching to text console. This patch spreads this logic consistently and also avoids grabbing the input while a text console is active. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud