aboutsummaryrefslogtreecommitdiff
path: root/ui
AgeCommit message (Collapse)AuthorFilesLines
2017-07-17vnc: Set default kbd delay to 10msAlexander Graf1-1/+1
The current VNC default keyboard delay is 1ms. With that we're constantly typing faster than the guest receives keyboard events from an XHCI attached USB HID device. The default keyboard delay time in the input layer however is 10ms. I don't know how that number came to be, but empirical tests on some OpenQA driven ARM systems show that 10ms really is a reasonable default number for the delay. This patch moves the VNC delay also to 10ms. That way our default is much safer (good!) and also consistent with the input layer default (also good!). Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1499863425-103133-1-git-send-email-agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-29ui/cocoa.m: Fix compatibility issue with Mac OS 10.9 and underJohn Arbuckle1-1/+1
The [NSEvent modifierFlags] method returns an NSEventModifierFlags type value in Mac OS 10.10. It use to be of type NSUInteger. Replacing NSEventModifierFlags with NSUInteger allows for the cooca.m file to be compiled on older versions of Mac OS. This patch was been tested on Mac OS 10.6 and Mac OS 10.12 without problem. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: F6C36C1A-4661-48F4-BEA6-3994889927D0@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-23ui/cocoa.m: add Speed menuJohn Arbuckle1-0/+56
Programs running inside of QEMU can sometimes use more CPU time than is really needed. To solve this problem, we just need to throttle the virtual CPU. This feature will stop laptops from burning up. This patch adds a menu called Speed that has menu items from 100% to 1% that represent the speed options. 100% is full speed and 1% is slowest. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: D6FAAABF-064D-49C0-B572-C73679F34052@gmail.com [PMM: Moved "mark 100% menu item as checked initially" code to after menu item is allocated, not before it] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-23sdl2: add assert to make coverity happyGerd Hoffmann1-0/+1
There is a loop a few lines up counting consoles and setting sdl2_num_outputs accordingly, so con ptr can't be NULL there. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170621122234.12751-1-kraxel@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-23input: Decrement queue count on kbd delayAlexander Graf1-0/+1
Delays in the input layer are special cased input events. Every input event is accounted for in a global intput queue count. The special cased delays however did not get removed from the queue, leading to queue overruns and thus silent key drops after typing quite a few characters. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1498117318-162102-1-git-send-email-agraf@suse.de Fixes: be1a7176 ("input: add support for kbd delays") Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-23keymaps: add tracingGerd Hoffmann2-15/+23
Drop commented debug logging, add trace points instead. Also cleanup parser code a bit, the key name is copied into a new variable instead of patching the input line, that way we can log the unmodified line. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606134736.26080-1-kraxel@redhat.com
2017-06-22Merge remote-tracking branch 'remotes/kraxel/tags/queue/ui-pull-request' ↵Peter Maydell8-154/+116
into staging # gpg: Signature made Wed 21 Jun 2017 14:23:31 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/queue/ui-pull-request: ui: Remove inclusion of "hw/qdev.h" console: remove do_safe_dpy_refresh gtk: use framebuffer helper functions. sdl2: use framebuffer helper functions. egl-headless: use framebuffer helper functions. egl-helpers: add helpers to handle opengl framebuffers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-22Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-06-09-v2' ↵Peter Maydell3-4/+2
into staging QAPI patches for 2017-06-09 # gpg: Signature made Tue 20 Jun 2017 13:31:39 BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2017-06-09-v2: (41 commits) tests/qdict: check more get_try_int() cases console: use get_uint() for "head" property i386/cpu: use get_uint() for "min-level"/"min-xlevel" properties numa: use get_uint() for "size" property pnv-core: use get_uint() for "core-pir" property pvpanic: use get_uint() for "ioport" property auxbus: use get_uint() for "addr" property arm: use get_uint() for "mp-affinity" property xen: use get_uint() for "max-ram-below-4g" property pc: use get_uint() for "hpet-intcap" property pc: use get_uint() for "apic-id" property pc: use get_uint() for "iobase" property acpi: use get_uint() for "pci-hole*" properties acpi: use get_uint() for various acpi properties acpi: use get_uint() for "acpi-pcihp-io*" properties platform-bus: use get_uint() for "addr" property bcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base" aspeed: use {set, get}_uint() for "ram-size" property pcihp: use get_uint() for "bsel" property pc-dimm: make "size" property uint64 ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-21ui: Remove inclusion of "hw/qdev.h"Thomas Huth2-2/+0
Looks like #include "hw/qdev.h" is not needed here, so remove it. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 1497894617-12143-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-21console: remove do_safe_dpy_refreshGerd Hoffmann1-24/+1
Drop the temporary workaround for the broken display updates. All display adapters are updated, so this should be safe without causing regressions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170614084538.32480-1-kraxel@redhat.com
2017-06-21gtk: use framebuffer helper functions.Gerd Hoffmann2-48/+14
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-5-kraxel@redhat.com
2017-06-21sdl2: use framebuffer helper functions.Gerd Hoffmann1-29/+7
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-4-kraxel@redhat.com
2017-06-21egl-headless: use framebuffer helper functions.Gerd Hoffmann1-51/+18
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-3-kraxel@redhat.com
2017-06-21egl-helpers: add helpers to handle opengl framebuffersGerd Hoffmann1-0/+76
Add a collection of egl_fb_*() helper functions to manage and use opengl framebuffers, which is a common pattern in UI code with opengl support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-2-kraxel@redhat.com
2017-06-20console: use get_uint() for "head" propertyMarc-André Lureau1-2/+2
TYPE_QEMU_CONSOLE property "head" is defined with object_property_add_uint*_ptr(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-41-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qapi: merge QInt and QFloat in QNumMarc-André Lureau2-2/+0
We would like to use a same QObject type to represent numbers, whether they are int, uint, or floats. Getters will allow some compatibility between the various types if the number fits other representations. Add a few more tests while at it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-7-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [parse_stats_intervals() simplified a bit, comment in test_visitor_in_int_overflow() tidied up, suppress bogus warnings] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-14spice: don't enter opengl mode in case another UI provides opengl supportGerd Hoffmann2-1/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606110618.10393-1-kraxel@redhat.com
2017-06-14spice: Use proper enum type for kbd led stateJonathon Jongsma1-1/+1
Although the Qemu and spice flags currently have the same value, it seems more correct to pass the spice flag values to spice_server_kbd_leds(), especially considering that this function already makes an effort to convert between the QEMU_*_LED and SPICE_KEYBOARD_MODIFIER_* values. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170510202006.31737-1-jjongsma@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-14Improve Cocoa modifier key handlingIan McKellar via Qemu-devel1-12/+48
I had two problems with QEMU on macOS: 1) Sometimes when alt-tabbing to QEMU it would act as if the 'a' key was pressed so I'd get 'aaaaaaaaa....'. 2) Using Sikuli to programatically send keys to the QEMU window text like "foo_bar" would come out as "fooa-bar". They looked similar and after much digging the problem turned out to be the same. When QEMU's ui/cocoa.m received an NSFlagsChanged NSEvent it looked at the keyCode to determine what modifier key changed. This usually works fine but sometimes the keyCode is 0 and the app should instead be looking at the modifierFlags bitmask. Key code 0 is the 'a' key. I added code that handles keyCode == 0 differently. It checks the modifierFlags and if they differ from QEMU's idea of which modifier keys are currently pressed it toggles those changed keys. This fixes my problems and seems work fine. Signed-off-by: Ian McKellar <ianloic@google.com> Message-id: 20170526233816.47627-1-ianloic@google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-06-13migration: Move remaining exported functions to migration/misc.hJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Xu <peterx@redhat.com>
2017-06-02char: move CharBackend handling in char-fe unitMarc-André Lureau1-1/+1
Move all the frontend struct and methods to a seperate unit. This avoids accidentally mixing backend and frontend calls, and helps with readabilty. Make qemu_chr_replay() a macro shared by both char and char-fe. Export qemu_chr_write(), and use a macro for qemu_chr_write_all() (nb: yes, CharBackend is for char frontend :) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-06-02chardev: move headers to include/chardevMarc-André Lureau2-2/+2
So they are all in one place. The following patch will move serial & parallel declarations to the respective headers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-30Merge remote-tracking branch 'armbru/tags/pull-qapi-2017-05-23' into stagingStefan Hajnoczi3-4/+4
QAPI patches for 2017-05-23 # gpg: Signature made Tue 23 May 2017 12:33:32 PM BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * armbru/tags/pull-qapi-2017-05-23: qapi-schema: Remove obsolete note from ObjectTypeInfo block: Use QDict helpers for --force-share shutdown: Expose bool cause in SHUTDOWN and RESET events shutdown: Add source information to SHUTDOWN and RESET shutdown: Preserve shutdown cause through replay shutdown: Prepare for use of an enum in reset/shutdown_request shutdown: Simplify shutdown_signal sockets: Plug memory leak in socket_address_flatten() scripts/qmp/qom-set: fix the value argument passed to srv.command() Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-23shutdown: Add source information to SHUTDOWN and RESETEric Blake3-4/+4
Time to wire up all the call sites that request a shutdown or reset to use the enum added in the previous patch. It would have been less churn to keep the common case with no arguments as meaning guest-triggered, and only modified the host-triggered code paths, via a wrapper function, but then we'd still have to audit that I didn't miss any host-triggered spots; changing the signature forces us to double-check that I correctly categorized all callers. Since command line options can change whether a guest reset request causes an actual reset vs. a shutdown, it's easy to also add the information to reset requests. Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts] Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part] Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x parts] Message-Id: <20170515214114.15442-5-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-19ui: egl-headless requires dmabuf supportGerd Hoffmann1-1/+1
Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170517122744.3541-1-kraxel@redhat.com
2017-05-12vnc: replace hweight_long() with ctpopl()Cédric Le Goater1-3/+3
ctpopl() has a better implementation than hweight_long() and ui/vnc.c being the last user of hweight_long(), we can simply remove it. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1489415605-13105-1-git-send-email-clg@kaod.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-12vnc: simple clean upWei Qi1-1/+0
It is unnecessary to assign 'packed_bytes' to 'estimated_bytes', because 'estimated_bytes' unused after assignment. Signed-off-by: Wei Qi <weiqi4@huawei.com> Reviewed-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-12opengl: add egl-headless displayGerd Hoffmann2-0/+159
Add egl-headless user interface. It doesn't provide a real user interface, it only provides opengl support using drm render nodes. It will copy back the bits rendered by the guest using virgl back to a DisplaySurface and kick the usual display update code paths, so spice and vnc and screendump can pick it up. Use it this way: qemu -display egl-headless -vnc $display qemu -display egl-headless -spice gl=off,$args Note that you should prefer native spice opengl support (-spice gl=on) if possible because that delivers better performance. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170505104101.30589-7-kraxel@redhat.com
2017-05-12egl: explicitly ask for core contextGerd Hoffmann2-3/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170505104101.30589-6-kraxel@redhat.com
2017-05-12egl-helpers: add missing error checkGerd Hoffmann1-1/+6
Code didn't check for qemu_egl_init_dpy_mesa() failures, add it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20170505104101.30589-5-kraxel@redhat.com
2017-05-12egl-helpers: fix display init for x11Gerd Hoffmann2-9/+27
When running on gtk we need X11 platform not mesa platform. Create separate functions for mesa and x11 so we can keep the egl #ifdef mess local to egl-helpers.c Fixes: 0ea1523fb6703aa0dcd65e66b59e96fec028e60a Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170505104101.30589-4-kraxel@redhat.com
2017-05-12egl-helpers: drop support for gles and debug loggingGerd Hoffmann2-48/+6
Leftover from the early opengl days. Unused now, so delete the dead code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170505104101.30589-3-kraxel@redhat.com
2017-05-11ui: input-linux: Add absolute event supportPhilippe Voinov1-1/+24
This patch adds support for absolute pointer events to the input-linux subsystem. This support was omitted from the original input-linux patch, however most of the code required for it is already in place. Support for absolute events is especially useful for guests with vga passthrough. Since they have a physical monitor, none of normal channels for sending video output (vnc, etc) are used, meaning they also can't be used to send absolute input events. This leaves QMP as the only option to send absolute input into vga passthrough guests, which is not its intended use and is not efficient. This patch allows, for example, uinput to be used to create virtual absolute input devices. This lets you build external systems which share physical input devices between guests. Without absolute input capability, such external systems can't seamlessly share pointer devices between guests. Signed-off-by: Philippe Voinov <philippevoinov@gmail.com> Message-id: 20170505134231.30210-1-philippevoinov@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-11ui: Support non-zero minimum values for absolute input axesPhilippe Voinov7-21/+34
This patch refactors ui/input.c to support absolute axis minimum values other than 0. All dependent calls to qemu_input_queue_abs have been updated to explicitly supply 0 as the axis minimum value. Signed-off-by: Philippe Voinov <philippevoinov@gmail.com> Message-id: 20170505133952.29885-1-philippevoinov@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-09sockets: Limit SocketAddressLegacy to external interfacesMarkus Armbruster2-75/+72
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09sockets: Rename SocketAddress to SocketAddressLegacyMarkus Armbruster2-55/+55
The next commit will rename SocketAddressFlat to SocketAddress, and the commit after that will replace most uses of SocketAddressLegacy by SocketAddress, replacing most of this commit's renames right back. Note that checkpatch emits a few "line over 80 characters" warnings. The long lines are all temporary; the SocketAddressLegacy replacement will shorten them again. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-5-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-05Merge remote-tracking branch 'elmarco/tags/chr-tests-pull-request' into stagingStefan Hajnoczi2-2/+2
# gpg: Signature made Thu 04 May 2017 12:42:10 PM BST # gpg: using RSA key 0xDAE8E10975969CE5 # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * elmarco/tags/chr-tests-pull-request: (21 commits) tests: add /char/console test tests: add /char/udp test tests: add /char/socket test tests: add /char/file test tests: add /char/pipe test tests: add alias check in /char/ringbuf char-udp: flush as much buffer as possible char-socket: add 'connected' property char-socket: add 'addr' property char-socket: update local address after listen char-socket: introduce update_disconnected_filename() char: useless NULL check char: remove chardevs list char: remove qemu_chardev_add char: use /chardevs container instead of chardevs list vl: add todo note about root container cleanup char: add a /chardevs container container: don't leak container reference xen: use a better chardev type check mux: simplfy muxes_realize_done ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-04char: remove qemu_chr_be_generic_openMarc-André Lureau2-2/+2
The function simply alias and hides the real event function. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-03input: don't queue delay if pausedMarc-André Lureau1-0/+4
qemu_input_event_send() discards key event when the guest is paused, but not the delay. The delay ends up in the input queue, and qemu_input_event_send_key() will further fill the queue with upcoming events. VNC uses qemu_input_event_send_key_delay(), not SPICE, which results in a different input behaviour on pause: VNC will queue the events (except the first that is discarded), SPICE will discard all events. Don't queue delay if paused, and provide same behaviour on SPICE and VNC clients on resume (and potentially avoid over-allocating the buffer queue) Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1444326 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170425130520.31819-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-05-03input: limit kbd queue depthGerd Hoffmann1-3/+11
Apply a limit to the number of items we accept into the keyboard queue. Impact: Without this limit vnc clients can exhaust host memory by sending keyboard events faster than qemu feeds them to the guest. Fixes: CVE-2017-8379 Cc: P J P <ppandit@redhat.com> Cc: Huawei PSIRT <PSIRT@huawei.com> Reported-by: jiangxin1@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170428084237.23960-1-kraxel@redhat.com
2017-04-25ui/cocoa.m: Fix macOS 10.12 deprecation warningsBrendan Shanks1-29/+58
macOS 10.12 deprecated/replaced many AppKit constants to make naming more consistent. Use the new constants, and #define them to the old constants when compiling against a pre-10.12 SDK. Signed-off-by: Brendan Shanks <brendan@bslabs.net> Message-id: 20170425062952.99149-1-brendan@bslabs.net Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-04-24console: add same displaychangelistener registration pre-conditionMarc-André Lureau1-0/+2
Catch an invalid state. Mainly useful for documentation purposes. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170406120513.638-3-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-04-24console: add same surface replace pre-conditionMarc-André Lureau1-0/+2
Catch an invalid state early, before a potential use-after-free. This is mainly useful for documentation purposes. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170406120513.638-2-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-04-03io vnc sockets: Clean up SocketAddressKind switchesMarkus Armbruster1-6/+12
We have quite a few switches over SocketAddressKind. Some have case labels for all enumeration values, others rely on a default label. Some abort when the value isn't a valid SocketAddressKind, others report an error then. Unify as follows. Always provide case labels for all enumeration values, to clarify intent. Abort when the value isn't a valid SocketAddressKind, because the program state is messed up then. Improve a few error messages while there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1490895797-29094-4-git-send-email-armbru@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-04-03nbd sockets vnc: Mark problematic address family tests TODOMarkus Armbruster1-0/+1
Certain features make sense only with certain address families. For instance, passing file descriptors requires AF_UNIX. Testing SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, but problematic: it can't recognize AF_UNIX when type == SOCKET_ADDRESS_KIND_FD. Mark such tests of saddr->type TODO. We may want to check the address family with getsockname() there. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1490895797-29094-2-git-send-email-armbru@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-04-03vnc: allow to connect with add_client when -vnc noneMarc-André Lureau1-4/+4
Do not skip VNC initialization, in particular of auth method when vnc is configured without sockets, since we should still allow connections through QMP add_client. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1434551 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170328160646.21250-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-04-03Fix input-linux reading from deviceJavier Celaya1-5/+12
The evdev devices in input-linux.c are read in blocks of one whole event. If there are not enough bytes available, they are discarded, instead of being kept for the next read operation. This results in lost events, of even non-working devices. This patch keeps track of the number of bytes to be read to fill up a whole event, and then handle it. Changes from v1 to v2: - Fix: Calculate offset on each iteration Changes from v2 to v3: - Fix coding style - Store offset instead of bytes to be read Signed-off-by: Javier Celaya <jcelaya@gmail.com> Message-id: 20170327182624.2914-1-jcelaya@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-03-28Merge remote-tracking branch ↵Peter Maydell1-7/+11
'remotes/stsquad/tags/pull-mttcg-fixups-for-rc2-280317-1' into staging MTTCG regression fixes for rc2 # gpg: Signature made Tue 28 Mar 2017 10:54:38 BST # gpg: using RSA key 0xFBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-mttcg-fixups-for-rc2-280317-1: replay/replay.c: bump REPLAY_VERSION tcg: Add a new line after incompatibility warning ui/console: use exclusive mechanism directly ui/console: ensure do_safe_dpy_refresh holds BQL bsd-user: align use of mmap_lock to that of linux-user user-exec: handle synchronous signals from QEMU gracefully Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-28ui/console: use exclusive mechanism directlyAlex Bennée1-7/+9
The previous commit (8bb93c6f99) using async_safe_run_on_cpu() doesn't work on graphics sub-system which restrict which threads can do GUI updates. Rather the special casing MacOS we just directly call the helper and move all the exclusive handling into do_dafe_dpy_refresh(). The unfortunate bouncing of the BQL is to ensure there is no deadlock as vCPUs waiting on the BQL are kicked into their quiescent state. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2017-03-28ui/console: ensure do_safe_dpy_refresh holds BQLAlex Bennée1-0/+2
I missed the fact that when an exclusive work item runs it drops the BQL to ensure all no vCPUs are stuck waiting for it, hence causing a deadlock. However the actual helper needs to take the BQL especially as we'll be messing with device emulation bits during the update which all assume BQL is held. We make a minor cpu_reloading_memory_map which must try and unlock the RCU if we are actually outside the running context. Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>