summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
* block: delete cow block driverStefan Hajnoczi2014-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes support for the cow file format. Normally we do not break backwards compatibility but in this case there is no impact and it is the most logical option. Extraordinary claims require extraordinary evidence so I will show why removing the cow block driver is the right thing to do. The cow file format is the disk image format for Usermode Linux, a way of running a Linux system in userspace. The performance of UML was never great and it was hacky, but it enjoyed some popularity before hardware virtualization support became mainstream. QEMU's block/cow.c is supposed to read this image file format. Unfortunately the file format was underspecified: 1. Earlier Linux versions used the MAXPATHLEN constant for the backing filename field. The value of MAXPATHLEN can change, so Linux switched to a 4096 literal but QEMU has a 1024 literal. 2. Padding was not used on the header struct (both in the Linux kernel and in QEMU) so the struct layout varied across architectures. In particular, i386 and x86_64 were different due to int64_t alignment differences. Linux now uses __attribute__((packed)), QEMU does not. Therefore: 1. QEMU cow images do not conform to the Linux cow image file format. 2. cow images cannot be shared between different host architectures. This means QEMU cow images are useless and QEMU has not had bug reports from users actually hitting these issues. Let's get rid of this thing, it serves no purpose and no one will be affected. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 1410877464-20481-1-git-send-email-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* vnc-tls: Clean up dead store in vnc_set_x509_credential()Markus Armbruster2014-09-181-2/+0
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/vnc: set TCP_NODELAYPeter Lieven2014-09-171-0/+1
| | | | | | | | | | | | | we currently have the Nagle algorithm enabled for all outgoing VNC updates. This may delay sensitive updates as mouse movements or typing in the console. As we currently prepare all data in a buffer and then send as much as we can disabling the Nagle algorithm should not cause big trouble. Well established VNC servers like TightVNC set TCP_NODELAY as well. A regular framebuffer update request generates exactly one framebuffer update which should be pushed out as fast as possible. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qemu-char: Rename register_char_driver_qapi() to register_char_driver()Peter Maydell2014-09-161-2/+1
| | | | | | | | | Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-6-git-send-email-peter.maydell@linaro.org
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20140916-1' into ↵Peter Maydell2014-09-162-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging Two minor sdl2 fixes. # gpg: Signature made Tue 16 Sep 2014 07:20:37 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-sdl-20140916-1: sdl2: keymap fixups sdl2: drop sdl_zoom.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * sdl2: keymap fixupsGerd Hoffmann2014-09-161-3/+4
| | | | | | | | | | | | Make a few keys works correctly in SDL2. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * sdl2: drop sdl_zoom.hGerd Hoffmann2014-09-161-1/+0
| | | | | | | | | | | | It isn't used. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: call qemu_spice_set_passwd() during initMarc-André Lureau2014-09-161-1/+1
|/ | | | | | | | | | | Don't call SPICE API directly to set password given in command line, but use the internal API, saving password for later calls. This solves losing password when changing expiration in qemu monitor. https://bugzilla.redhat.com/show_bug.cgi?id=1138639 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-20140905-2' ↵Peter Maydell2014-09-114-152/+208
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging console: pixman switchover continued, add some infrastructure to make it easier using pixman in display device emulation. # gpg: Signature made Fri 05 Sep 2014 14:38:57 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-console-20140905-2: console: Remove unused QEMU_BIG_ENDIAN_FLAG console: add qemu_pixman_linebuf_copy console: add dpy_gfx_update_dirty console: add qemu_create_displaysurface_guestmem console: stop using PixelFormat console: reimplement qemu_default_pixelformat console: add qemu_default_pixman_format console: add qemu_pixelformat_from_pixman Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * console: Remove unused QEMU_BIG_ENDIAN_FLAGBenjamin Herrenschmidt2014-09-052-15/+4
| | | | | | | | | | | | | | | | | | If we need to, we should use the pixman formats instead but for now this is unused except in commented out code so take it out to avoid further confusion about surface endianness. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: add qemu_pixman_linebuf_copyGerd Hoffmann2014-09-051-0/+9
| | | | | | | | | | | | | | Helper function for copying data from linebuf to framebuffer using pixman, possibly converting in case src and dst formats differ. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: add dpy_gfx_update_dirtyGerd Hoffmann2014-09-051-0/+61
| | | | | | | | | | | | | | | | Calls dpy_gfx_update for all dirty scanlines. Works for DisplaySurfaces backed by guest memory (i.e. the ones created using qemu_create_displaysurface_guestmem). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: add qemu_create_displaysurface_guestmemGerd Hoffmann2014-09-051-0/+37
| | | | | | | | | | | | | | | | | | This patch adds a qemu_create_displaysurface_guestmem helper function. Works simliar to qemu_create_displaysurface_from, but accepts a guest address instead of a host pointer and it handles cpu_physical_memory_{map,unmap} for you. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: stop using PixelFormatGerd Hoffmann2014-09-052-25/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch the qemu console core stops using PixelFormat and pixman format codes side-by-side, pixman format code is the primary way to specify the DisplaySurface format: * DisplaySurface stops carrying a PixelFormat field. * qemu_create_displaysurface_from() expects a pixman format now. Functions to convert PixelFormat to pixman_format_code_t (and back) exist for those who still use PixelFormat. As PixelFormat allows easy access to masks and shifts it will probably continue to exist. [ xenfb added by Benjamin Herrenschmidt ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: reimplement qemu_default_pixelformatGerd Hoffmann2014-09-051-113/+4
| | | | | | | | | | | | | | | | Use the new qemu_pixelformat_from_pixman and qemu_default_pixman_format functions to reimplement qemu_default_pixelformat (qemu_different_endianness_pixelformat too). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: add qemu_default_pixman_formatGerd Hoffmann2014-09-051-0/+25
| | | | | | | | | | | | Function returning the default pixman format for a given depth. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * console: add qemu_pixelformat_from_pixmanGerd Hoffmann2014-09-051-0/+56
| | | | | | | | | | | | | | | | Function to convert pixman format codes to qemu PixelFormat. [ Benjamin Herrenschmidt: fix BGRA+RGBA shifts ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: make sure we don't overflow ssd->bufGerd Hoffmann2014-09-051-5/+15
|/ | | | | | | | | | | | | | | | | | | | | | Related spice-only bug. We have a fixed 16 MB buffer here, being presented to the spice-server as qxl video memory in case spice is used with a non-qxl card. It's also used with qxl in vga mode. When using display resolutions requiring more than 16 MB of memory we are going to overflow that buffer. In theory the guest can write, indirectly via spice-server. The spice-server clears the memory after setting a new video mode though, triggering a segfault in the overflow case, so qemu crashes before the guest has a chance to do something evil. Fix that by switching to dynamic allocation for the buffer. CVE-2014-3615 Cc: qemu-stable@nongnu.org Cc: secalert@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* spice: use console index as display idGerd Hoffmann2014-09-011-2/+1
| | | | | | ... instead of maintaining our own numbering. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: don't use 'Yoda conditions'Gonglei2014-08-151-2/+2
| | | | | | | | imitate nearby code about using '!value' or 'value == NULL' Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* vnc update fixGerd Hoffmann2014-07-252-1/+4
| | | | | | | | | | | We need to remember has_updates for each vnc client. Otherwise it might happen that vnc_update_client(has_dirty=1) takes the first exit due to output buffers not being flushed yet and subsequent calls with has_dirty=0 take the second exit, wrongly assuming there is nothing to do because the work defered in the first call is ignored. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de>
* fix full frame updates for VNC clientsStephan Kulow2014-07-251-0/+1
| | | | | | | | | If the client asks for !incremental frame updates, it has lost its content so dirty doesn't matter - it has to see the full frame, so setting force_update Signed-off-by: Stephan Kulow <coolo@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de>
* Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20140711-1' into ↵Peter Maydell2014-07-111-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging spice: auth fixes # gpg: Signature made Fri 11 Jul 2014 10:17:15 BST using RSA key ID D3E87138 # 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>" * remotes/spice/tags/pull-spice-20140711-1: spice: auth fixes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * spice: auth fixesGerd Hoffmann2014-07-111-0/+5
| | | | | | | | | | | | | | | | Set auth to sasl when sasl is enabled, this makes "info spice" correctly display sasl auth. Also throw an error in case someone tries to set a spice password via monitor without auth mode being "spice". Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | ui/gtk: Restore keyboard focus after Page changeJohn Snow2014-07-111-3/+6
|/ | | | | | | | | | | | | | | | | | | (Resending for correct email addresses via MAINTAINERS ...) In the GTK UI, after changing focus to the qemu monitor Notebook Page, when restoring focus to the virtual machine page, the keyboard focus is lost to a hidden GTK widget. Focus can only be restored to the virtual machine by pressing "tab" or any of the four directional arrow keys. Clicking in the window or grabbing/ungrabbing input does not restore keyboard focus to the child widget. This patch adjusts the Notebook page switching callback to automatically steal keyboard focus on the Page switch event, so that keyboard input does not appear to break or disappear after tabbing to the QEMU monitor. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/vnc: fix potential memory corruption issuesPeter Lieven2014-07-012-86/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch makes the VNC server work correctly if the server surface and the guest surface have different sizes. Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of VNC_DIRTY_PIXELS_PER_BIT. If we have a resolution whose width is not dividable by VNC_DIRTY_PIXELS_PER_BIT we now get a small black bar on the right of the screen. If the surface is too big to fit the limits only the upper left area is shown. On top of that this fixes 2 memory corruption issues: The first was actually discovered during playing around with a Windows 7 vServer. During resolution change in Windows 7 it happens sometimes that Windows changes to an intermediate resolution where server_stride % cmp_bytes != 0 (in vnc_refresh_server_surface). This happens only if width % VNC_DIRTY_PIXELS_PER_BIT != 0. The second is a theoretical issue, but is maybe exploitable by the guest. If for some reason the guest surface size is bigger than VNC_MAX_WIDTH x VNC_MAX_HEIGHT we end up in severe corruption since this limit is nowhere enforced. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/vnc: limit client_cut_text msg payload sizePeter Lieven2014-07-011-3/+10
| | | | | | | | | | | | | | | | currently a malicious client could define a payload size of 2^32 - 1 bytes and send up to that size of data to the vnc server. The server would allocated that amount of memory which could easily create an out of memory condition. This patch limits the payload size to 1MB max. Please note that client_cut_text messages are currently silently ignored. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/cocoa: Honour -show-cursor command line optionPeter Maydell2014-06-291-2/+18
| | | | | | | | Honour the -show-cursor command line option (which forces the mouse pointer to always be displayed even when input is grabbed) in the Cocoa UI backend. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-5-git-send-email-peter.maydell@linaro.org
* ui/cocoa: Fix handling of absolute positioning devicesPeter Maydell2014-06-291-29/+46
| | | | | | | | | | | | | | | | | | | | | | Fix handling of absolute positioning devices, which were basically unusable for two separate reasons: (1) as soon as you pressed the left mouse button we would call CGAssociateMouseAndMouseCursorPosition(FALSE), which means that the absolute coordinates of the mouse events are never updated (2) we didn't account for MacOSX coordinate origin being bottom left rather than top right, and so all the Y values sent to the guest were inverted We fix (1) by aligning our behaviour with the SDL UI backend for absolute devices: * when the mouse moves into the window we do a grab (which means hiding the host cursor and sending special keys to the guest) * when the mouse moves out of the window we un-grab and fix (2) by doing the correct transformation in the call to qemu_input_queue_abs(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-4-git-send-email-peter.maydell@linaro.org
* ui/cocoa: Add utility method to check if point is within windowPeter Maydell2014-06-291-2/+7
| | | | | | | | | Add a utility method to check whether a point is within the current window bounds, and use it in the various places in the mouse handling code that were opencoding the check. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-3-git-send-email-peter.maydell@linaro.org
* ui/cocoa: Cope with first surface being same as initial window sizePeter Maydell2014-06-291-1/+5
| | | | | | | | | | | | Do the recalculation of the content dimensions in switchSurface if the current cdx is zero as well as if the new surface is a different size to the current window. This catches the case where the first surface registered happens to be 640x480 (our current window size), and fixes a bug where we would always display a black screen until the first surface of a different size was registered. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-2-git-send-email-peter.maydell@linaro.org
* qemu-char: introduce qemu_chr_allocPaolo Bonzini2014-06-231-1/+1
| | | | | | | | | The next patch will modify this function to initialize state that is common to all backends. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi event: convert SPICE eventsWenchao Xia2014-06-231-34/+36
| | | | | | | | | | | | | | | SPICE_INITIALIZED, SPICE_CONNECTED, SPICE_DISCONNECTED and SPICE_MIGRATE_COMPLETED are converted in one patch, since they use some common functions. inet_strfamily() is removed since no callers exist anymore. Note that there is no existing doc for SPICE_MIGRATE_COMPLETED in docs/qmp/qmp-events.txt before this patch. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi event: convert VNC eventsWenchao Xia2014-06-232-56/+59
| | | | | | | | | | Since VNC_CONNECTED, VNC_DISCONNECTED, VNC_INITIALIZED share some common functions, convert them in one patch. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi: adjust existing definesWenchao Xia2014-06-232-7/+9
| | | | | | | | | | | | | | | In order to let event defines use existing types later, instead of redefine new ones, some old type defines for spice and vnc are changed, and BlockErrorAction is moved from block.h to qapi schema. Note that BlockErrorAction is not merged with BlockdevOnError. At this point, VncInfo is not made a child of VncBasicInfo, because VncBasicInfo has mandatory fields where VncInfo makes them optional. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140619-1' into ↵Peter Maydell2014-06-202-15/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging vnc: cleanups and fixes # gpg: Signature made Thu 19 Jun 2014 12:02:09 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-vnc-20140619-1: vnc: fix screen updates vnc: Drop superfluous conditionals around g_strdup() vnc: Drop superfluous conditionals around g_free() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vnc: fix screen updatesGerd Hoffmann2014-06-191-0/+3
| | | | | | | | | | | | | | | | Bug was added by 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380. vnc_jobs_join call is missing in one code path. Reported-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * vnc: Drop superfluous conditionals around g_strdup()Markus Armbruster2014-06-191-4/+1
| | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * vnc: Drop superfluous conditionals around g_free()Markus Armbruster2014-06-192-12/+6
| | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: fix 32bit buildGerd Hoffmann2014-06-201-1/+1
|/ | | | | | | Tested-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1403244764-8622-1-git-send-email-kraxel@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* spice: add mouse cursor supportGerd Hoffmann2014-06-131-11/+118
| | | | | | | So you'll have a mouse pointer when running non-qxl gfx cards with mouse pointer support (virtio-gpu, IIRC vmware too). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* gtk: update window size after showing/hiding tabsGerd Hoffmann2014-06-111-0/+2
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* gtk: factor out gtk3 grab into the new gd_grab_devices functionGerd Hoffmann2014-06-111-64/+36
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* gtk: cleanup backend dependenciesGerd Hoffmann2014-06-111-28/+42
| | | | | | | | | | | | | | Make configure detect gtk x11 backend and link libX11 then. Make gtk backend specific code properly #ifdef'ed on the GTK_WINDOWING_* backends at runtime). Our gtk ui code should build and run fine on any platform now. This also fixes the linker failute due to the new XkbGetKeyboard call added by commit 3158a3482b0093e41f2b2596fba50774ea31ae08. Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* gtk: factor out keycode mappingGerd Hoffmann2014-06-111-7/+16
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: fix -vga none -sdl crashGerd Hoffmann2014-06-101-4/+1
| | | | | | | Call get_alloc_displaystate() for proper initialization instead of allocating with g_new(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: kill MAX_CONSOLES, alloc consoles dynamicallyGerd Hoffmann2014-06-101-9/+4
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input/vnc: use kbd delays in press_keyGerd Hoffmann2014-06-041-0/+2
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input/curses: add kbd delay between keydown and keyup eventsGerd Hoffmann2014-06-041-0/+10
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: use kbd delays for send_key monitor commandGerd Hoffmann2014-06-041-39/+6
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud