summaryrefslogtreecommitdiffstats
path: root/ui
Commit message (Collapse)AuthorAgeFilesLines
* util: pull Buffer code out of VNC moduleDaniel P. Berrange2015-10-202-58/+1
| | | | | | | The Buffer code in the VNC server is useful for the IO channel code, so pull it out into a shared module, QIOBuffer. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* ui: convert VNC startup code to use SocketAddressDaniel P. Berrange2015-10-201-70/+90
| | | | | | | | | | The VNC code is currently using QemuOpts to configure the sockets connections / listeners it needs. Convert it to use SocketAddress to bring it in line with modern QAPI based code elsewhere in QEMU. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2015-10-192-5/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * KVM page size fix for PPC * Support for Linux 4.4's new Hyper-V features * Eliminate g_slice from areas I maintain * checkpatch fix * Peter's cpu_reload_memory_map() cleanups * More changes to MAINTAINERS * Require Python 2.6 * chardev creation fixes * PCI requester id for ARM KVM * cleanups and doc fixes * Allow customization of the Hyper-V vendor id # gpg: Signature made Mon 19 Oct 2015 09:13:10 BST using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: (49 commits) kvm: Allow the Hyper-V vendor ID to be specified kvm: Move x86-specific functions into target-i386/kvm.c kvm: Pass PCI device pointer to MSI routing functions hw/pci: Introduce pci_requester_id() kvm: Make KVM_CAP_SIGNAL_MSI globally available doc/rcu: fix g_free_rcu() usage example qemu-char: cleanup after completed conversion to cd->create qemu-char: convert ringbuf backend to data-driven creation qemu-char: convert vc backend to data-driven creation qemu-char: convert spice backend to data-driven creation qemu-char: convert console backend to data-driven creation qemu-char: convert stdio backend to data-driven creation qemu-char: convert testdev backend to data-driven creation qemu-char: convert braille backend to data-driven creation qemu-char: convert msmouse backend to data-driven creation qemu-char: convert mux backend to data-driven creation qemu-char: convert null backend to data-driven creation qemu-char: convert pty backend to data-driven creation qemu-char: convert UDP backend to data-driven creation qemu-char: convert socket backend to data-driven creation ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qemu-char: convert vc backend to data-driven creationPaolo Bonzini2015-10-192-5/+7
| | | | | | | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * qemu-char: add create to register_char_driverPaolo Bonzini2015-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Having creation as a member of the CharDriver struct removes the need to export functions for qemu-char.c's usage. After the conversion, chardev backends implemented outside qemu-char.c will not need a stub creation function anymore. Ultimately all drivers will be converted. For now, support the case where cd->create == NULL. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | ui/cocoa.m: blinky mouse cursor fixJohn Arbuckle2015-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | The mouse cursor can become blinky when being moved a lot. This patch fixes that problem by issuing the redraw sooner. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: AAA87DD7-EC20-4F4B-B71E-C38461D9FCBA@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | ui/cocoa.m: addRemovableDevicesMenuItems() warning fixJohn Arbuckle2015-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate this warning associated with the addRemovableDevicesMenuItems() function: ui/cocoa.m:1344:13: warning: function declaration isn't a prototype [-Wstrict-prototypes] static void addRemovableDevicesMenuItems() ^ ui/cocoa.m: In function 'addRemovableDevicesMenuItems': ui/cocoa.m:1344:13: warning: old-style function definition [-Wold-style-definition] Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 7B365FC2-072B-4E8D-A1D9-922C2D691A83@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | ui/cocoa.m: eliminate normalWindow warningJohn Arbuckle2015-10-131-1/+1
|/ | | | | | | | | | | | | | Eliminate this warning associated with the setting of the normalWindow's title: ui/cocoa.m: In function '-[QemuCocoaAppController init]': ui/cocoa.m:888:9: warning: format not a string literal and no format arguments [-Wformat-security] [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]]; Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 57057D6E-C108-4AE1-8370-E7E6855B2F2C@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* gtk/opengl: add opengl context and scanout support (GtkGLArea)Gerd Hoffmann2015-10-083-24/+334
| | | | | | | | This allows virtio-gpu to render in 3d mode. Uses native opengl support which is present in gtk versions 3.16 and newer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* gtk/opengl: add opengl context and scanout support (egl)Gerd Hoffmann2015-10-082-8/+130
| | | | | | | | This allows virtio-gpu to render in 3d mode. Uses egl, for gtk versions 3.14 and older. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* opengl: add egl-context.[ch] helpersGerd Hoffmann2015-10-082-0/+35
| | | | | | | Add helper functions to manage opengl contexts using egl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* ui/console: add opengl context and scanout support interfaces.Gerd Hoffmann2015-10-081-2/+65
| | | | | | | | Add callbacks for opengl context management and scanout texture configuration to DisplayChangeListenerOps. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* sdl2: stop flickeringGerd Hoffmann2015-10-081-0/+13
| | | | | | | | | Optimizing updates by copying the dirty rectangle only do not work because of double-buffering. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* shaders: initialize vertexes onceGerd Hoffmann2015-10-082-6/+32
| | | | | | | | | | Create a buffer for the vertex data and place vertexes there at initialization time. Then just use the buffer for each texture blit. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* ui/cocoa.m: remove open dialog codeJohn Arbuckle2015-09-251-54/+2
| | | | | | | | | | | | Removes the open dialog code that runs when no arguments are supplied with QEMU. Not everyone needs a hard drive or cdrom to boot their target. A user might only need to use their target's bios to do work. With that said, this patch removes the unneeded open dialog code. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 33856864-321C-4367-9170-FB0BF81E789B@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* ui/cocoa.m: prevent stuck key situationJohn Arbuckle2015-09-251-0/+26
| | | | | | | | | | | | | | | When the user puts QEMU in the background while holding down a key, QEMU will not receive the keyup event when the user lets go of the key. When the user goes back to QEMU, QEMU will think the key is still down causing stuck key symptoms. This patch fixes this problem by releasing all down keys when QEMU goes into the background. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 7A3FA6EE-84C8-4422-A786-C899B7229D32@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* ui/cocoa.m: verify with user before quitting QEMUJohn Arbuckle2015-09-251-1/+38
| | | | | | | | | | | | This patch prevents the user from accidentally quitting QEMU by pushing Command-Q or by pushing the close button on the main window. When the user does one of these two things, a dialog box appears verifying with the user if he or she wants to quit QEMU. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 29169A74-0347-47F5-934F-A5AD24C225CA@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* gtk: avoid redefining _WIN32_WINNT macroDaniel P. Berrange2015-09-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When building for Mingw64 target on Fedora 22 a warning is issued about _WIN32_WINNT being redefined. In file included from ui/gtk.c:40:0: include/ui/gtk.h:5:0: warning: "_WIN32_WINNT" redefined # define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */ ^ In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0, from /usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:9, from /home/berrange/src/virt/qemu/include/qemu/fprintf-fn.h:12, from /home/berrange/src/virt/qemu/include/qemu-common.h:18, from ui/gtk.c:37: /usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h:225:0: note: this is the location of the previous definition #define _WIN32_WINNT 0x502 ^ Rather than try to get MAPVK_VK_TO_VSC defined indirectly by defining _WIN32_WINNT, instead just define it explicitly if missing. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
* spice: surface switch fast path requires same format too.Gerd Hoffmann2015-09-211-1/+2
| | | | | | | | | | | | | | | Commit "555e72f spice: rework mirror allocation, add no-resize fast path" adds a fast path for surface switches which does't go through the full primary surface destroy and re-recreation in case the new surface is identical to the old one (page-flip). It checks the size only though, but the format must be identical too. This patch adds the format check. Commit "0002a51 ui/spice: Support shared surface for most pixman formats" increases the chance to actually trigger this. https://bugzilla.redhat.com/show_bug.cgi?id=1247479 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* cocoa: Suppress Cocoa window with -displayRainer Müller2015-09-181-0/+1
| | | | | | | | | | | Do not open a Cocoa window when another display is selected that will be initialized later. The Cocoa display cannot be selected with -display, so there is no need to check its argument. Signed-off-by: Rainer Müller <raimue@codingfarm.de> Reviewed-by: Andreas Färber <andreas.faerber@web.de> Message-id: 1441807710-25431-1-git-send-email-raimue@codingfarm.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch ↵Peter Maydell2015-09-159-780/+350
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/berrange/tags/vnc-crypto-v9-for-upstream' into staging Merge vnc-crypto-v9 # gpg: Signature made Tue 15 Sep 2015 15:32:38 BST using RSA key ID 15104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" * remotes/berrange/tags/vnc-crypto-v9-for-upstream: ui: convert VNC server to use QCryptoTLSSession ui: fix return type for VNC I/O functions to be ssize_t crypto: introduce new module for handling TLS sessions crypto: add sanity checking of TLS x509 credentials crypto: introduce new module for TLS x509 credentials crypto: introduce new module for TLS anonymous credentials crypto: introduce new base module for TLS credentials qom: allow QOM to be linked into tools binaries crypto: move crypto objects out of libqemuutil.la tests: remove repetition in unit test object deps qapi: allow override of default enum prefix naming Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * ui: convert VNC server to use QCryptoTLSSessionDaniel P. Berrange2015-09-159-766/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch VNC server over to using the QCryptoTLSSession object for the TLS session. This removes the direct use of gnutls from the VNC server code. It also removes most knowledge about TLS certificate handling from the VNC server code. This has the nice effect that all the CONFIG_VNC_TLS conditionals go away and the user gets an actual error message when requesting TLS instead of it being silently ignored. With this change, the existing configuration options for enabling TLS with -vnc are deprecated. Old syntax for anon-DH credentials: -vnc hostname:0,tls New syntax: -object tls-creds-anon,id=tls0,endpoint=server \ -vnc hostname:0,tls-creds=tls0 Old syntax for x509 credentials, no client certs: -vnc hostname:0,tls,x509=/path/to/certs New syntax: -object tls-creds-x509,id=tls0,dir=/path/to/certs,endpoint=server,verify-peer=no \ -vnc hostname:0,tls-creds=tls0 Old syntax for x509 credentials, requiring client certs: -vnc hostname:0,tls,x509verify=/path/to/certs New syntax: -object tls-creds-x509,id=tls0,dir=/path/to/certs,endpoint=server,verify-peer=yes \ -vnc hostname:0,tls-creds=tls0 This aligns VNC with the way TLS credentials are to be configured in the future for chardev, nbd and migration backends. It also has the benefit that the same TLS credentials can be shared across multiple VNC server instances, if desired. If someone uses the deprecated syntax, it will internally result in the creation of a 'tls-creds' object with an ID based on the VNC server ID. This allows backwards compat with the CLI syntax, while still deleting all the original TLS code from the VNC server. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
| * ui: fix return type for VNC I/O functions to be ssize_tDaniel P. Berrange2015-09-152-21/+21
| | | | | | | | | | | | | | | | | | | | | | Various VNC server I/O functions return 'long' and then also pass this to a method accepting 'int'. All these should be ssize_t to match the signature of read/write APIs and thus avoid potential for integer truncation / wraparound. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | gtk: use setlocale() for LC_MESSAGES onlyAlberto Garcia2015-09-151-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QEMU code is not internationalized and assumes that it runs under the C locale, but if we use the GTK+ UI we'll end up importing the locale settings from the environment. This can break things, such as the JSON generator and iotest 120 in locales that use a decimal comma. We do however have translations for a few simple strings for the GTK+ menu items, so in order to run QEMU using the C locale, and yet have a translated UI let's use setlocale() for LC_MESSAGES only. Cc: qemu-stable@nongnu.org Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | gtk: don't grab input when entering fullscreen.Gerd Hoffmann2015-09-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Kick off all grabbing logic from fullscreen mode. In the current state it seems to create more problems than it solves. Try running qemu/gtk fullscreen on one head of a multihead host for example ... There probably was a reason the grab-on-fullscreen logic was added in the first place. So please test and report any issues so we can try to find a sane way to handle it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* | gtk: set free_scale when setting zoom_fitGerd Hoffmann2015-09-151-0/+1
| | | | | | | | | | | | | | | | free_scale field tracks zoom-fit menu toggle state, so we should keep them in sync ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* | gtk: trace input grab reasonGerd Hoffmann2015-09-151-13/+13
| | | | | | | | | | | | | | | | Add a reason to grab calls and trace points, so it is easier to debug grab related ui issues. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* | gtk: move gd_update_caption calls to gd_{grab,ungrab}_{pointer,keyboard}Gerd Hoffmann2015-09-151-5/+4
| | | | | | | | | | | | | | | | Then we don't have to pair the grab/ungrab calls with update_caption calls any more because things happen automatically ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* | gtk: check for existing grabs in gd_grab_{pointer,keyboard}Gerd Hoffmann2015-09-151-5/+20
|/ | | | | | | | | | | If a grab is already active for our window, do nothing. If a grab is already active for another window, release it. Cleanup some checks and ungrab calls in the code which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* maint: avoid useless "if (foo) free(foo)" patternDaniel P. Berrange2015-09-111-10/+4
| | | | | | | | | | | | The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* vnc: fix memory corruption (CVE-2015-5225)Gerd Hoffmann2015-08-261-5/+10
| | | | | | | | | | | | | | | | | | | | The _cmp_bytes variable added by commit "bea60dd ui/vnc: fix potential memory corruption issues" can become negative. Result is (possibly exploitable) memory corruption. Reason for that is it uses the stride instead of bytes per scanline to apply limits. For the server surface is is actually fine. vnc creates that itself, there is never any padding and thus scanline length always equals stride. For the guest surface scanline length and stride are typically identical too, but it doesn't has to be that way. So add and use a new variable (guest_ll) for the guest scanline length. Also rename min_stride to line_bytes to make more clear what it actually is. Finally sprinkle in an assert() to make sure we never use a negative _cmp_bytes again. Reported-by: 范祚至(库特) <zuozhi.fzz@alibaba-inc.com> Reviewed-by: P J P <ppandit@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* vnc: fix memory leakGonglei2015-07-241-1/+4
| | | | | | | | | | | If vnc's password is configured, it will leak memory which cipher variable pointed on every vnc connection. Cc: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1437556133-11268-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vnc: fix vnc client authenticationWolfgang Bumiller2015-07-141-1/+1
| | | | | | | | | | | | Commit 800567a61 updated the code to the generic crypto API and mixed up encrypt and decrypt functions in procotol_client_auth_vnc. (Used to be: deskey(key, EN0) which encrypts, and was changed to qcrypto_cipher_decrypt in 800567a61.) Changed it to qcrypto_cipher_encrypt now. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui: convert VNC to use generic cipher APIDaniel P. Berrange2015-07-081-11/+41
| | | | | | | | | | Switch the VNC server over to use the generic cipher API, this allows it to use the pluggable DES implementations, instead of being hardcoded to use QEMU's built-in impl. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1435770638-25715-11-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ui: convert VNC websockets to use crypto APIsDaniel P. Berrange2015-07-085-77/+24
| | | | | | | | | | | Remove the direct use of gnutls for hash processing in the websockets code, in favour of using the crypto APIs. This allows the websockets code to be built unconditionally removing countless conditional checks from the VNC code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1435770638-25715-9-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* crypto: move built-in D3DES implementation into crypto/Daniel P. Berrange2015-07-074-466/+2
| | | | | | | | | | | | | | | | To prepare for a generic internal cipher API, move the built-in D3DES implementation into the crypto/ directory. This is not in fact a normal D3DES implementation, it is D3DES with double & triple length modes removed, and the key bytes in reversed bit order. IOW it is crippled specifically for the "benefit" of RFB, so call the new files desrfb.c instead of d3des.c to make it clear that it isn't a generally useful impl. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1435770638-25715-4-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Include monitor/monitor.h exactly where neededMarkus Armbruster2015-06-223-2/+1
| | | | | | | | | In particular, don't include it into headers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* Include qapi/qmp/qerror.h exactly where neededMarkus Armbruster2015-06-221-0/+1
| | | | | | | | | In particular, don't include it into headers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: Move #include out of qerror.hMarkus Armbruster2015-06-223-0/+3
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: Clean up QERR_ macros to expand into a single stringMarkus Armbruster2015-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | These macros expand into error class enumeration constant, comma, string. Unclean. Has been that way since commit 13f59ae. The error class is always ERROR_CLASS_GENERIC_ERROR since the previous commit. Clean up as follows: * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and delete it from the QERR_ macro. No change after preprocessing. * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into error_setg(...). Again, no change after preprocessing. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: Eliminate QERR_DEVICE_NOT_FOUNDMarkus Armbruster2015-06-221-1/+2
| | | | | | | | | | | | | | | | | | Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used in new code. Hiding them in QERR_ macros makes new uses hard to spot. Fortunately, there's just one such macro left. Eliminate it with this coccinelle semantic patch: @@ expression EP, E; @@ -error_set(EP, QERR_DEVICE_NOT_FOUND, E) +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* QemuOpts: Wean off qerror_report_err()Markus Armbruster2015-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qerror_report_err() is a transitional interface to help with converting existing monitor commands to QMP. It should not be used elsewhere. The only remaining user in qemu-option.c is qemu_opts_parse(). Is it used in QMP context? If not, we can simply replace qerror_report_err() by error_report_err(). The uses in qemu-img.c, qemu-io.c, qemu-nbd.c and under tests/ are clearly not in QMP context. The uses in vl.c aren't either, because the only QMP command handlers there are qmp_query_status() and qmp_query_machines(), and they don't call it. Remaining uses: * drive_def(): Command line -drive and such, HMP drive_add and pci_add * hmp_chardev_add(): HMP chardev-add * monitor_parse_command(): HMP core * tmp_config_parse(): Command line -tpmdev * net_host_device_add(): HMP host_net_add * net_client_parse(): Command line -net and -netdev * qemu_global_option(): Command line -global * vnc_parse_func(): Command line -display, -vnc, default display, HMP change, QMP change. Bummer. * qemu_pci_hot_add_nic(): HMP pci_add * usb_net_init(): Command line -usbdevice, HMP usb_add Propagate errors through qemu_opts_parse(). Create a convenience function qemu_opts_parse_noisily() that passes errors to error_report_err(). Switch all non-QMP users outside tests to it. That leaves vnc_parse_func(). Propagate errors through it. Since I'm touching it anyway, rename it to vnc_parse(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* ui/cocoa.m: Add machine menu items to change and eject removable drive mediaJohn Arbuckle2015-06-191-3/+153
| | | | | | | | | | Adds all removable devices to the Machine menu as a Change and Eject menu item pair. ide-cd0 would have a "Change ide-cd0..." and "Eject ide-cd0" menu items. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* ui/cocoa.m: Add Reset and Power Down menu items to Machine menuJohn Arbuckle2015-06-191-0/+17
| | | | | | | | Add "Reset" and "Power Down" menu items to Machine menu. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* ui/cocoa.m: Add Machine menu with pause and resume menu itemsJohn Arbuckle2015-06-191-0/+67
| | | | | | | | | | | Add Machine menu to the Macintosh interface with pause and resume menu items. These items can either pause or resume execution of the guest operating system. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 6D7AE6AA-0595-4FAD-AACF-9DFAB87248F0@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Change qemu_set_fd_handler2(..., NULL, ...) to qemu_set_fd_handlerFam Zheng2015-06-124-20/+17
| | | | | | | | | | | | | | | Done with following Coccinelle semantic patch, plus manual cosmetic changes in net/*.c. @@ expression E1, E2, E3, E4; @@ - qemu_set_fd_handler2(E1, NULL, E2, E3, E4); + qemu_set_fd_handler(E1, E2, E3, E4); Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1433400324-7358-8-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150611-1' into ↵Peter Maydell2015-06-111-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging sdl2: fix crash in handle_windowevent() when restoring the screen size # gpg: Signature made Thu Jun 11 08:57:38 2015 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-20150611-1: sdl2: fix crash in handle_windowevent() when restoring the screen size Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * sdl2: fix crash in handle_windowevent() when restoring the screen sizeAlberto Garcia2015-06-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The Ctrl-Alt-u keyboard shortcut restores the screen to its original size. In the SDL2 UI this is done by destroying the window and creating a new one. The old window emits SDL_WINDOWEVENT_HIDDEN when it's destroyed, but trying to call SDL_GetWindowFromID() from that event's window ID returns a null pointer. handle_windowevent() assumes that the pointer is never null so it results in a crash. Cc: qemu-stable@nongnu.org Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150611-1' into ↵Peter Maydell2015-06-111-13/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging spice: fix segfault in qemu_spice_create_update, ui_info tweaks. # gpg: Signature made Thu Jun 11 08:48:49 2015 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-20150611-1: spice: ui_info tweaks spice-display: fix segfault in qemu_spice_create_update Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | spice: ui_info tweaksGerd Hoffmann2015-06-111-9/+8
| | | | | | | | | | | | | | | | | | | | | Use the new dpy_ui_info_supported function. Clarifies the control flow. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud