aboutsummaryrefslogtreecommitdiff
path: root/ui
AgeCommit message (Collapse)AuthorFilesLines
2021-03-09sysemu: Let VMChangeStateHandler take boolean 'running' argumentPhilippe Mathieu-Daudé2-2/+2
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20210111152020.1422021-3-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-03-09ui: Replace the word 'whitelist'Philippe Mathieu-Daudé2-3/+3
Follow the inclusive terminology from the "Conscious Language in your Open Source Projects" guidelines [*] and replace the words "whitelist" appropriately. [*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210303184644.1639691-2-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-03-04ui/console: Pass placeholder surface to displaysAkihiko Odaki6-25/+23
ui/console used to accept NULL as graphic console surface, but its semantics was inconsistent among displays: - cocoa and gtk-egl perform NULL dereference. - egl-headless, spice and spice-egl do nothing. - gtk releases underlying resources. - sdl2-2d and sdl2-gl destroys the window. - vnc shows a message, "Display output is not active." Fortunately, only virtio-gpu and virtio-gpu-3d assign NULL so we can study them to figure out the desired behavior. They assign NULL *except* for the primary display when the device is realized, reset, or its scanout is disabled. This effectively destroys windows for the (uninitialized) secondary displays. To implement the consistent behavior of display device realization/reset, this change embeds it to the operation switching the surface. When NULL was given as a new surface when switching, ui/console will instead passes a placeholder down to each display listeners. sdl destroys the window for a secondary console if its surface is a placeholder. The other displays simply shows the placeholder. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210225101316.83940-2-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-04ui/console: Add placeholder flag to message surfaceAkihiko Odaki2-6/+7
The surfaces created with former qemu_create_message_surface did not display the content from the guest and always contained simple messages describing the reason. A display backend may want to hide the window showing such a surface. This change renames the function to qemu_create_placeholder_surface, and adds "placeholder" flag; the display can check the flag to decide to do anything special like hiding the window. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210225101316.83940-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-04ui/cocoa: Replace fprintf with error_reportAkihiko Odaki1-3/+3
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210223131106.21166-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-04configure: Improve OpenGL dependency detectionsAkihiko Odaki5-9/+29
This has the following visible changes: - GBM is required only for OpenGL dma-buf. - X11 is explicitly required by gtk-egl. - EGL is now mandatory for the OpenGL displays. The last one needs some detailed description. Before this change, EGL was tested only for OpenGL dma-buf with the check of EGL_MESA_image_dma_buf_export. However, all of the OpenGL displays depend on EGL and EGL_MESA_image_dma_buf_export is always defined by epoxy's EGL interface. Therefore, it makes more sense to always check the presence of EGL and say the OpenGL displays are available along with OpenGL dma-buf if it is present. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210223060307.87736-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-04ui/cocoa: Fix stride resolution of pixman imageAkihiko Odaki1-4/+4
A display can receive an image which its stride is greater than its width. In fact, when a guest requests virtio-gpu to scan out a smaller part of an image, virtio-gpu passes it to a display as an image which its width represents the one of the part and its stride equals to the one of the whole image. This change makes ui/cocoa to cover such cases. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210222144012.21486-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-04ui/gtk: vte: fix sending multiple characetersZack Marvel1-1/+10
When using the GTK UI with libvte, multicharacter keystrokes are not sent correctly (such as arrow keys). gd_vc_in should check the CharBackend's can_receive instead of assuming multiple characters can be received. This is not an issue for e.g. the SDL UI because qemu_chr_be_write is called with len=1 for each character (SDL sends more than once keystroke). Modify gd_vc_in to call qemu_chr_be_write multiple times if necessary. Buglink: https://bugs.launchpad.net/qemu/+bug/1407808 Signed-off-by: Zack Marvel <zpmarvel@gmail.com> Message-Id: <20210221170613.13183-2-zpmarvel@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-03ui/cocoa: Remove the uses of full screen APIsAkihiko Odaki1-26/+15
The detections of [NSView -enterFullScreen:] and [NSView -exitFullScreen:] were wrong. A detection is coded as: [NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)] but it should be: [NSView instancesRespondToSelector:@selector(exitFullScreenModeWithOptions:)] Because of those APIs were not detected, ui/cocoa always falled back to a borderless window whose frame matches the screen to implement fullscreen behavior. The code using [NSView -enterFullScreen:] and [NSView -exitFullScreen:] will be used if you fix the detections, but its behavior is undesirable; the full screen view stretches the video, changing the aspect ratio, even if zooming is disabled. This change removes the code as it does nothing good. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210220013138.51437-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19ui/console: Remove dpy_gl_ctx_get_currentAkihiko Odaki1-5/+0
It is not used, and it is unlikely that a new use case will emerge anytime soon because the scope of OpenGL contexts are limited due to the nature of the frontend, VirGL, processing simple commands from the guest. Remove the function and ease implementing a new OpenGL backend a little. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210219094702.90789-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19ui/cocoa: Statically allocate dclAkihiko Odaki1-34/+31
There is no need of dynamic allocation as dcl is a small singleton. Static allocation reduces code size and makes hacking with ui/cocoa a bit easier. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210219084419.90181-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19ui/cocoa: Interpret left button down as is when command is pressedAkihiko Odaki1-10/+2
Old Macs were not equipped with mice with an ability to perform "right clicks" and ui/cocoa interpreted left button down with left command key pressed as right button down as a workaround. The workaround has an obvious downside: you cannot tell the guest that the left button is down while the left command key is pressed. Today, Macs has trackpads, Apple Mice, or Magic Mice. They are capable to emulate right clicks with gestures, which also allows to perform right clicks on "BootCamp" OSes like Windows. By removing the workaround, we overcome its downside, and provide a behavior consistent with BootCamp. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210212000706.28616-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19spice-app: avoid crash when core spice module doesn't loadedBruce Rogers1-1/+7
When qemu is built with modules, but a given module doesn't load qemu should handle that gracefully. When ui-spice-core.so isn't able to be loaded and qemu is invoked with -display spice-app or -spice, qemu will dereference a null pointer. With this change we check the pointer before dereferencing and error out in a normal way. Signed-off-by: Bruce Rogers <brogers@suse.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210213032318.346093-1-brogers@suse.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19ui/cocoa: Do not copy members of pixman imageAkihiko Odaki1-22/+20
The old CocoaView had an idea of synchronizing the host window configuration and the guest screen configuration. Here, the guest screen actually means pixman image given ui/cocoa display implementation. However, [CocoaView -drawRect:] directly interacts with the pixman image buffer in reality. There is no such distinction of "host" and "guest." This change removes the "host" configuration and let drawRect consistently have the direct reference to pixman image. It allows to get rid of the error-prone "sync" and reduce code size a bit. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210212000629.28551-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19ui/cocoa: Support unique keys of JIS keyboardsAkihiko Odaki1-0/+7
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210212000404.28413-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19spice: flush drawing before notifying clientMarc-André Lureau1-0/+1
This solves the client having slow/outdated VGA/2D console. It's a regression introduced when the code was switched to render it via opengl in commit 4423184376d ("spice/gl: render DisplaySurface via opengl") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210216092056.2301293-2-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-19spice: flush on GL update before notifying clientMarc-André Lureau1-0/+1
Since the introduction of spice/virgl support in commit 474114b7 ("spice: add opengl/virgl/dmabuf support"), the drawing isn't being flushed before notifying the client. This results in outdated/sluggish drawing on client side, in particular when using the Linux console. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210216092056.2301293-1-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04display/ui: add a callback to indicate GL state is flushedMarc-André Lureau5-0/+18
Displaying rendered resources requires blocking qemu GPU to avoid extra framebuffer copies. For an external display, via Spice currently, there is a callback to block/unblock the rendering in the same thread. But with the vhost-user-gpu backend, the qemu process doesn't handle the rendering itself, and the blocking callback isn't effective. Instead, the backend must be notified when the display code is done. Fix this by adding a new GraphicHwOps callback to indicate the GL state is flushed, and we are done manipulating the shared GL resources. Call it from gtk and spice display. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-19-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: add egl dmabuf import to gtkglareaMarc-André Lureau2-0/+40
GtkGLArea is used on wayland, where EGL is usually available. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-17-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: check gtk-egl dmabuf supportMarc-André Lureau1-0/+9
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-16-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: add qemu_egl_has_dmabuf helperMarc-André Lureau1-0/+10
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-15-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: check hw requirements during DCL registrationMarc-André Lureau1-0/+30
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-14-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: add a DCLOps callback to check dmabuf supportMarc-André Lureau1-0/+13
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-13-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: remove console_has_gl_dmabuf()Marc-André Lureau1-5/+0
This check is currently limited. It only is used by vhost-user-gpu (not by vfio-display), and will print an error repeatedly during run-time. We are going to dissociate the GL context from the DisplayChangeListener, and listeners may come and go. The following patches will address this differently. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-10-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: add gd_gl_area_scanout_disableMarc-André Lureau3-6/+9
Require the callback, drop the fallback path. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-8-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: remove gl_ctx_get_currentMarc-André Lureau7-24/+0
There are no users left. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-7-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04ui: remove extra #ifdef CONFIG_OPENGLMarc-André Lureau1-8/+1
Since commit 5cb69566daa8081abb82a13403dcc0fffed02007 ("gtk: remove CONFIG_GTK_GL"), some #ifdef are redundants. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-6-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-02-04spice: delay starting until display are initializedMarc-André Lureau2-1/+10
QEMU used to run qemu_spice.display_init() before vm_start(), and QXL/display interfaces where started then. Now, vm_start() happens before QXL/display interfaces are added and Spice server doesn't automatically start them in this case (fixed in spice git) Fixes Spice regression introduced after 5.2, with refactoring commits b4e1a34211 ("vl: remove separate preconfig main_loop") and facf7c60ee ("vl: initialize displays _after_ exiting preconfiguration"), probably others. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210129152351.161971-1-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-29ui: update keycodemapdb submodule commitDaniel P. Berrangé2-1/+2
Primarily this is to pull in a fix for Win32 keycodes. The other useful change is the removal of build timestamp from generated files which is desirable for reproducable builds. The make rules need updating due to slightly changed CLI syntax - more args must now come after the command name. 6119e6e19a050df847418de7babe5166779955e4 Fix scan codes for Korean keys 685684a8404301780714e8a89a871981e7cae988 Fix argument order in output headers b3774853042c951b200d767697285781cc59a83c Add HTML entries for Korean layout keys 8e54850d800e4697a2798fb82ac740e760f8530b Add macOS entries for Japanese keyboards 27acf0ef828bf719b2053ba398b195829413dbdd Fix win32 keycode for VK_OEM_102 317d3eeb963a515e15a63fa356d8ebcda7041a51 Add support for generating RST formatted docs pages 7381b9bfadd31c4c9e9a10b5bb5032f9189d4352 Introduce separate args for title & subtitle with docs generator 6280c94f306df6a20bbc100ba15a5a81af0366e6 keymap-gen: Name sections in pod output df4e56f8fab65ba714ec18f4e7338a966a1620ad Add an empty meson project 16e5b0787687d8904dad2c026107409eb9bfcb95 remove buildtime from generated files 044f21dd0d4f62519aae9f1d53a026407a0b664f add header file generators 7779876a6b06755e3bb2c94ee3ded50635bcb0fa c++: add extern declaration to the generated file 0e0a317889464397d6f1ae03aad0d2ca593aab04 move CLanguageGenerator closer to CLanguageGenerator itself Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-01-28Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-01-28' into ↵Peter Maydell1-19/+12
staging QAPI patches patches for 2021-01-28 # gpg: Signature made Thu 28 Jan 2021 07:10:21 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2021-01-28: qapi: More complex uses of QAPI_LIST_APPEND qapi: Use QAPI_LIST_APPEND in trivial cases qapi: Introduce QAPI_LIST_APPEND qapi: A couple more QAPI_LIST_PREPEND() stragglers net: Clarify early exit condition Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-28qapi: More complex uses of QAPI_LIST_APPENDEric Blake1-19/+12
These cases require a bit more thought to review; in each case, the code was appending to a list, but not with a FOOList **tail variable. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210113221013.390592-6-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Flawed change to qmp_guest_network_get_interfaces() dropped] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2021-01-27vnc: send extended desktop resize on update requestsGerd Hoffmann1-0/+3
Unlike other pseudo-encodings these don't break gtk-vnc because older versions don't suport the extended desktop resize extension in the first place. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210125104041.495274-3-kraxel@redhat.com>
2021-01-27Revert "vnc: move initialization to framebuffer_update_request"Gerd Hoffmann1-4/+7
This reverts commit 9e1632ad07ca49de99da4bb231e9e2f22f2d8df5. Older gtk-vnc versions can't deal with non-incremental update requests sending pseudo-encodings, so trying to send full server state (including desktop size, cursor etc. which is done using pseudo-encodings) doesn't fly. Return to old behavior to send those only for new connects and when changes happen. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210125104041.495274-2-kraxel@redhat.com>
2021-01-23vnc: support "-vnc help"Paolo Bonzini2-8/+7
Use qemu_opts_parse_noisily now that HMP does not call vnc_parse anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20210120144235.345983-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-15vnc: add support for extended desktop resizeGerd Hoffmann2-1/+65
The extended desktop resize encoding adds support for (a) clients sending resize requests to the server, and (b) multihead support. This patch implements (a). All resize requests are rejected by qemu. Qemu can't resize the framebuffer on its own, this is in the hands of the guest, so all qemu can do is forward the request to the guest. Should the guest actually resize the framebuffer we can notify the vnc client later with a separate message. This requires support in the display device. Works with virtio-gpu. https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#extendeddesktopsize-pseudo-encoding Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20210112134120.2031837-4-kraxel@redhat.com
2021-01-15vnc: move initialization to framebuffer_update_requestGerd Hoffmann1-7/+4
qemu sends various state info like current cursor shape to newly connected clients in response to a set_encoding message. This is not correct according to the rfb spec. Send that information in response to a full (incremental=0) framebuffer update request instead. Also send the resize information unconditionally, not only in case of an actual server-side change. This makes the qemu vnc server conform to the spec and allows clients to request the complete vnc server state without reconnect. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20210112134120.2031837-3-kraxel@redhat.com
2021-01-15vnc: move check into vnc_cursor_defineGerd Hoffmann1-6/+6
Move the check whenever a cursor exists into the vnc_cursor_define() function so callers don't have to do it. Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20210112134120.2031837-2-kraxel@redhat.com
2021-01-15vnc: Fix a memleak in vnc_display_connect()Alex Chen1-0/+1
Free the 'sioc' when the qio_channel_socket_connect_sync() fails. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20201126065702.35095-1-alex.chen@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui: add support for remote power control to VNC serverDaniel P. Berrangé2-0/+72
The "XVP" (Xen VNC Proxy) extension defines a mechanism for a VNC client to issue power control requests to trigger graceful shutdown, reboot, or hard reset. This option is not enabled by default, since we cannot assume that users with VNC access implicitly have administrator access to the guest OS. Thus is it enabled with a boolean "power-control" option e.g. -vnc :1,power-control=on While, QEMU can easily support shutdown and reset, there's no easy way to wire up reboot support at this time. In theory it could be done by issuing a shutdown, followed by a reset, but there's no convenient wiring for such a pairing in QEMU. It also isn't possible to have the VNC server directly talk to QEMU guest agent, since the agent chardev is typically owned by an external mgmt app. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> [ kraxel: rebase to master ] [ kraxel: add missing break ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15vnc: fix unfinalized tlscreds for VncDisplayZihao Chang1-1/+1
In vnc_display_open(), if tls-creds is enabled, do object_ref(object ref 1->2) for tls-creds. While in vnc_display_close(), object_unparent sets object ref to 1(2->1) and unparent the object for root. Problem: 1. the object can not be found from the objects_root, while the object is not finalized. 2. the qemu_opts of tls-creds(id: creds0) is not deleted, so new tls object with the same id(creds0) can not be delete & add. Signed-off-by: Zihao Chang <changzihao1@huawei.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20210111131911.805-1-changzihao1@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui/gtk: update monitor interval on egl displaysNikola Pavlica1-0/+3
When running QEMU's GTK UI without EGL or OGL, the gd_monitor_update_interval function gets executed and the display refresh rate gets updated accordingly. However, when using EGL or just regular OGL, the function never gets executed. Which is why I decided that the function should be in gd_egl_refresh where the display output gets updated, in the same vain as how it's done for normal GTK UIs (aka. those without EGL) - in it's display refresh function. Since the gd_monitor_update_interval function now is exposed, we are going to use it to update the refresh rate. Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com> Message-Id: <20210114140153.301473-3-pavlica.nikola@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui/gtk: expose gd_monitor_update_intervalNikola Pavlica1-1/+1
The gd_egl_refresh function, as the name suggests, is responsible for refreshing displays when using EGL graphics with QEMU's GTK UI. This is a perfect candidate for a function to update the refresh rate in. Since gd_monitor_update_interval is inaccessible from the gd_egl_refresh function, we need to expose/globalize it in the include/ui/gtk.h file. Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com> Message-Id: <20210114140153.301473-2-pavlica.nikola@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui/gtk: limit virtual console max update intervalVolker Rümelin1-11/+11
Limit the virtual console maximum update interval to GUI_REFRESH_INTERVAL_DEFAULT. This papers over a integer overflow bug in gtk3 on Windows where the reported monitor refresh frequency can be much smaller than the real refresh frequency. The gtk bug report can be found here: https://gitlab.gnome.org/GNOME/gtk/-/issues/3394 On my Windows 10 system gtk reports a monitor refresh rate of 1.511Hz instead of 60.031Hz and slows down the screen update rate in qemu to a crawl. Provided you are affected by the gtk bug on Windows, these are the steps to reproduce the issue: Start qemu with -display gtk and activate all qemu virtual consoles and notice the reduced qemu refresh rate. Activating all virtual consoles is necessary, because gui_update() in ui/console.c uses the minimum of all display change listeners update interval and not yet activated virtual consoles report the default update interval (30ms). Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20201213165724.13418-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui/gtk: rename variable window to widgetVolker Rümelin1-3/+3
The type of the variable window is GtkWidget. Rename the variable from window to widget, because windows and widgets are different things. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20201213165724.13418-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-15ui/gtk: don't try to redefine SI prefixesVolker Rümelin1-1/+2
Redefining SI prefixes is always wrong. 1s has per definition 1000ms. Remove the misnamed named constant and replace it with a comment explaining the frequency to period conversion in two simple steps. Now you can cancel out the unit mHz in the comment with the implicit unit mHz in refresh_rate_millihz and see why the implicit unit ms for update_interval remains. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20201213165724.13418-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-01-12Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into ↵Peter Maydell2-14/+13
staging * UI configury cleanups and Meson conversion * scripts/gdb improvements * WHPX cleanups and fixes * cirrus win32 CI improvements * meson gnutls workaround # gpg: Signature made Tue 12 Jan 2021 16:05:19 GMT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: target/i386: Use X86Seg enum for segment registers configure: quote command line arguments in config.status configure: move Cocoa incompatibility checks to Meson configure: move GTK+ detection to Meson configure: move X11 detection to Meson gtk: remove CONFIG_GTK_GL cocoa: do not enable coreaudio automatically virtio-scsi: trace events meson: Propagate gnutls dependency Docs/RCU: Correct sample code of qatomic_rcu_set scripts/gdb: implement 'qemu bt' scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame meson: fix Cocoa option in summary whpx: move whpx_lapic_state from header to c file maintainers: Add me as Windows Hosted Continuous Integration maintainer cirrus/msys2: Cache msys2 mingw in a better way. cirrus/msys2: Exit powershell with $LastExitCode whpx: move internal definitions to whpx-internal.h whpx: rename whp-dispatch to whpx-internal.h meson: do not use CONFIG_VIRTFS Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-12ui/cocoa: Fix openFile: deprecation on Big SurRoman Bolshakov1-1/+4
ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead. [-Wdeprecated-declarations] if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) { ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note: 'openFile:' has been explicitly marked deprecated here - (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0)); ^ Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20210102150718.47618-1-r.bolshakov@yadro.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-01-12configure: move GTK+ detection to MesonPaolo Bonzini1-1/+1
This also allows removing CONFIG_NEED_X11, all the ingredients can be computed easily in meson.build. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-12configure: move X11 detection to MesonPaolo Bonzini1-2/+2
For now move the logic verbatim. GTK+ actually has a hard requirement on X11 if gtk+x11 is present, but we will sort that out later. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-12gtk: remove CONFIG_GTK_GLPaolo Bonzini2-10/+9
CONFIG_GTK_GL is defined if OpenGL is present and GTK+ is 3.16 or newer. Since GTK+ 3.22 is the minimum supported version, just use CONFIG_OPENGL instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>