Skip to content
Snippets Groups Projects
  1. May 04, 2017
  2. Apr 25, 2017
  3. Apr 24, 2017
  4. Apr 03, 2017
  5. Mar 28, 2017
  6. Mar 27, 2017
    • Gerd Hoffmann's avatar
      vnc: fix reverse mode · e5766eb4
      Gerd Hoffmann authored
      
      vnc server in reverse mode (qemu -vnc localhost:$nr,reverse) interprets
      $nr as display number (i.e. with 5900 offset) in recent qemu versions.
      Historical and documented behavior is interpreting $nr as port number
      though. So we should bring code and documentation in line.
      
      Given that default listening port for viewers is 5500 the 5900 offset is
      pretty inconvinient, because it is simply impossible to connect to port
      5500.  So, lets fix the code not the docs.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1489480018-11443-1-git-send-email-kraxel@redhat.com
      e5766eb4
    • Gerd Hoffmann's avatar
      ui/egl-helpers: fix egl 1.5 display init · 8bce03e3
      Gerd Hoffmann authored
      
      Unfortunaly switching to getPlatformDisplayEXT isn't as easy as
      implemented by 0ea1523f.  See the
      longish comment for the complete story.
      
      Cc: Frediano Ziglio <fziglio@redhat.com>
      Suggested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489997042-1824-1-git-send-email-kraxel@redhat.com
      8bce03e3
  7. Mar 21, 2017
  8. Mar 20, 2017
  9. Mar 17, 2017
    • Alex Bennée's avatar
      ui/console: ensure graphic updates don't race with TCG vCPUs · 8bb93c6f
      Alex Bennée authored
      
      Commit 8d04fb55..
      
        tcg: drop global lock during TCG code execution
      
      ..broke the assumption that updates to the GUI couldn't happen at the
      same time as TCG vCPUs where running. As a result the TCG vCPU could
      still be updating a directly mapped frame-buffer while the display
      side was updating. This would cause artefacts to appear when the
      update code assumed that memory block hadn't changed.
      
      The simplest solution is to ensure the two things can't happen at the
      same time like the old BQL locking scheme. Here we use the solution
      introduced for MTTCG and schedule the update as async_safe_work when
      we know no vCPUs can be running.
      
      Reported-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20170315144825.3108-1-alex.bennee@linaro.org
      Cc: BALATON Zoltan <balaton@eik.bme.hu>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      
      [ kraxel: updated comment clarifying the display adapters are buggy
                and this is a temporary workaround ]
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      8bb93c6f
  10. Mar 16, 2017
    • Gerd Hoffmann's avatar
      cirrus/vnc: zap bitblit support from console code. · 50628d34
      Gerd Hoffmann authored
      
      There is a special code path (dpy_gfx_copy) to allow graphic emulation
      notify user interface code about bitblit operations carryed out by
      guests.  It is supported by cirrus and vnc server.  The intended purpose
      is to optimize display scrolls and just send over the scroll op instead
      of a full display update.
      
      This is rarely used these days though because modern guests simply don't
      use the cirrus blitter any more.  Any linux guest using the cirrus drm
      driver doesn't.  Any windows guest newer than winxp doesn't ship with a
      cirrus driver any more and thus uses the cirrus as simple framebuffer.
      
      So this code tends to bitrot and bugs can go unnoticed for a long time.
      See for example commit "3e10c3ec vnc: fix qemu crash because of SIGSEGV"
      which fixes a bug lingering in the code for almost a year, added by
      commit "c7628bff vnc: only alloc server surface with clients connected".
      
      Also the vnc server will throttle the frame rate in case it figures the
      network can't keep up (send buffers are full).  This doesn't work with
      dpy_gfx_copy, for any copy operation sent to the vnc client we have to
      send all outstanding updates beforehand, otherwise the vnc client might
      run the client side blit on outdated data and thereby corrupt the
      display.  So this dpy_gfx_copy "optimization" might even make things
      worse on slow network links.
      
      Lets kill it once for all.
      
      Oh, and one more reason: Turns out (after writing the patch) we have a
      security bug in that code path ...
      
      Fixes: CVE-2016-9603
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489494419-14340-1-git-send-email-kraxel@redhat.com
      50628d34
  11. Mar 14, 2017
  12. Feb 27, 2017
  13. Feb 20, 2017
  14. Feb 09, 2017
  15. Feb 08, 2017
    • Daniel P. Berrangé's avatar
      ui: refactor VncDisplay to allow multiple listening sockets · 4ee74fa7
      Daniel P. Berrangé authored
      
      Currently there is only a single listener for plain VNC and
      a single listener for websockets VNC. This means that if
      getaddrinfo() returns multiple IP addresses, for a hostname,
      the VNC server can only listen on one of them. This is
      just bearable if listening on wildcard interface, or if
      the host only has a single network interface to listen on,
      but if there are multiple NICs and the VNC server needs
      to listen on 2 or more specific IP addresses, it can't be
      done.
      
      This refactors the VncDisplay state so that it holds an
      array of listening sockets, but still only listens on
      one socket.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170203120649.15637-4-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      4ee74fa7
    • Daniel P. Berrangé's avatar
      ui: fix reporting of VNC auth in query-vnc-servers · 2a7e6857
      Daniel P. Berrangé authored
      
      Currently the VNC authentication info is emitted at the
      top level of the query-vnc-servers data. This is wrong
      because the authentication scheme differs between plain
      and websockets when TLS is enabled. We should instead
      report auth against the individual servers. e.g.
      
      (QEMU) query-vnc-servers
      {
          "return": [
              {
                  "clients": [],
                  "id": "default",
                  "auth": "vencrypt",
                  "vencrypt": "x509-vnc",
                  "server": [
                      {
                          "host": "127.0.0.1"
                          "service": "5901",
                          "websocket": false,
                          "family": "ipv4",
                          "auth": "vencrypt",
                          "vencrypt": "x509-vnc"
                      },
                      {
                          "host": "127.0.0.1",
                          "service": "5902",
                          "websocket": true,
                          "family": "ipv4",
                          "auth": "vnc"
                      }
                  ]
              }
          ]
      }
      
      This also future proofs the QMP schema so that we can
      cope with multiple VNC server instances, listening on
      different interfaces or ports, with different auth
      setup.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170203120649.15637-3-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      2a7e6857
    • Daniel P. Berrangé's avatar
      ui: fix regression handling bare 'websocket' option to -vnc · 1b1aeb58
      Daniel P. Berrangé authored
      
      The -vnc argument is documented as accepting two syntaxes for
      the 'websocket' option, either a bare option name, or a port
      number. If using the bare option name, it is supposed to apply
      the display number as an offset to base port 5700. e.g.
      
        -vnc localhost:3,websocket
      
      should listen on port 5703, however, this was broken in 2.3.0 since
      
        commit 4db14629
        Author: Gerd Hoffmann <kraxel@redhat.com>
        Date:   Tue Sep 16 12:33:03 2014 +0200
      
          vnc: switch to QemuOpts, allow multiple servers
      
      instead qemu tries to listen on port "on" which gets looked up in
      /etc/services and fails.
      
      Fixes bug: #1455912
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170203120649.15637-2-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      1b1aeb58
    • Michael Tokarev's avatar
      vnc: do not disconnect on EAGAIN · 537848ee
      Michael Tokarev authored
      
      When qemu vnc server is trying to send large update to clients,
      there might be a situation when system responds with something
      like EAGAIN, indicating that there's no system memory to send
      that much data (depending on the network speed, client and server
      and what is happening).  In this case, something like this happens
      on qemu side (from strace):
      
      sendmsg(16, {msg_name(0)=NULL,
              msg_iov(1)=[{"\244\"..., 729186}],
              msg_controllen=0, msg_flags=0}, 0) = 103950
      sendmsg(16, {msg_name(0)=NULL,
              msg_iov(1)=[{"lz\346"..., 1559618}],
              msg_controllen=0, msg_flags=0}, 0) = -1 EAGAIN
      sendmsg(-1, {msg_name(0)=NULL,
              msg_iov(1)=[{"lz\346"..., 1559618}],
              msg_controllen=0, msg_flags=0}, 0) = -1 EBADF
      
      qemu closes the socket before the retry, and obviously it gets EBADF
      when trying to send to -1.
      
      This is because there WAS a special handling for EAGAIN, but now it doesn't
      work anymore, after commit 04d2529d, because
      now in all error-like cases we initiate vnc disconnect.
      
      This change were introduced in qemu 2.6, and caused numerous grief for many
      people, resulting in their vnc clients reporting sporadic random disconnects
      from vnc server.
      
      Fix that by doing the disconnect only when necessary, i.e. omitting this
      very case of EAGAIN.
      
      Hopefully the existing condition (comparing with QIO_CHANNEL_ERR_BLOCK)
      is sufficient, as the original code (before the above commit) were
      checking for other errno values too.
      
      Apparently there's another (semi?)bug exist somewhere here, since the
      code tries to write to fd# -1, it probably should check if the connection
      is open before. But this isn't important.
      
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1486115549-9398-1-git-send-email-mjt@msgid.tls.msk.ru
      Fixes: 04d2529d
      Cc: Daniel P. Berrange <berrange@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      537848ee
    • Peter Maydell's avatar
      ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear() · c3ff04b6
      Peter Maydell authored
      
      The functions vnc_has_job() and vnc_jobs_clear() are
      never used; remove them.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarGonglei <arei.gonglei@huawei.com>
      Message-id: 1486146260-8092-1-git-send-email-peter.maydell@linaro.org
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      c3ff04b6
  16. Jan 31, 2017
    • Gerd Hoffmann's avatar
      console: fix console resize · 3ef0c573
      Gerd Hoffmann authored
      
      Only skip surface reallocation in case the old surface was created using
      qemu_alloc_display (via qemu_create_displaysurface) too, otherwise we
      might end up with a DisplaySurface with the wrong backing storage.
      
      Cc: 1658634@bugs.launchpad.net
      Fixes: cd958edb
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Tested-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Message-id: 1485256239-12219-1-git-send-email-kraxel@redhat.com
      3ef0c573
    • Kevin Wolf's avatar
      gtk: Hardcode LC_CTYPE as C.utf-8 · 27b224a6
      Kevin Wolf authored
      Commit 2cb5d2a4 removed setlocale() for everything except LC_MESSAGES in
      order to avoid unwanted side effects such as using the wrong decimal
      separator in generated JSON objects. However, the problem that unsetting
      LC_CTYPE caused is that non-ASCII characters are considered
      non-printable now and therefore the GTK menus display question marks for
      accented letters, Chinese characters etc.
      
      A first attempt to fix this [1] was rejected because even just setting
      LC_CTYPE to the user's locale (and thereby modifying the semantics of
      the ctype.h functions) could have unwanted effects that we're not aware
      of yet.
      
      Recently, however, glibc introduced a new locale "C.utf-8" that just
      uses UTF-8 as its charset, but otherwise leaves the semantics alone.
      Just setting the right character set is enough for our use case, so we
      can just hardcode this one without having to be afraid of nasty side
      effects.
      
      Older systems that don't have the new locale will continue displaying
      question marks, but this should fix the problem for most users.
      
      [1] https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03591.html
      
      
          ('Re: gtk: use setlocale() for LC_MESSAGES only')
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-id: 20170131100945.8189-1-kwolf@redhat.com
      
      [ kraxel: change C.utf-8 to C.UTF-8 ]
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      27b224a6
    • Marc-André Lureau's avatar
      char: remove class kind field · 0b663b7d
      Marc-André Lureau authored
      
      The class kind is necessary to lookup the chardev name in
      qmp_chardev_add() after calling qemu_chr_new_from_opts() and to set
      the appropriate ChardevBackend (mainly to free the right
      fields).
      
      qemu_chr_new_from_opts() can be changed to use a non-qmp function
      using the chardev class typename. Introduce qemu_chardev_add() to be
      called from qemu_chr_new_from_opts() and remove the class chardev kind
      field. Set the backend->type in the parse callback (when non-common
      fields are added).
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      0b663b7d
    • Marc-André Lureau's avatar
      char: get rid of CharDriver · 88cace9f
      Marc-André Lureau authored
      
      qemu_chr_new_from_opts() is modified to not need CharDriver backend[]
      array, but uses instead objectified qmp_query_chardev_backends() and
      char_get_class(). The alias field is moved outside in a ChardevAlias[],
      similar to QDevAlias for devices.
      
      "kind" and "parse" are moved to ChardevClass ("kind" is to be removed
      next)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      88cace9f
Loading