qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] c3ff04: ui/vnc: Drop unused vnc_has_job() and


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] c3ff04: ui/vnc: Drop unused vnc_has_job() and vnc_jobs_cle...
Date: Thu, 09 Feb 2017 10:15:09 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c3ff04b60d8b2710843ffcbc5335927db94531a8
      
https://github.com/qemu/qemu/commit/c3ff04b60d8b2710843ffcbc5335927db94531a8
  Author: Peter Maydell <address@hidden>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M ui/vnc-jobs.c
    M ui/vnc-jobs.h

  Log Message:
  -----------
  ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()

The functions vnc_has_job() and vnc_jobs_clear() are
never used; remove them.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 537848ee62195fc06c328b1cd64f4218f404a7f1
      
https://github.com/qemu/qemu/commit/537848ee62195fc06c328b1cd64f4218f404a7f1
  Author: Michael Tokarev <address@hidden>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  vnc: do not disconnect on EAGAIN

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 04d2529da27db512dcbd5e99d0e26d333f16efcc, 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: Michael Tokarev <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Fixes: 04d2529da27db512dcbd5e99d0e26d333f16efcc
Cc: Daniel P. Berrange <address@hidden>
Cc: Gerd Hoffmann <address@hidden>
Cc: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 1b1aeb5828c978af2ec4478e552884004f23c470
      
https://github.com/qemu/qemu/commit/1b1aeb5828c978af2ec4478e552884004f23c470
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  ui: fix regression handling bare 'websocket' option to -vnc

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 4db14629c38611061fc19ec6927405923de84f08
  Author: Gerd Hoffmann <address@hidden>
  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: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 2a7e6857cd3178d705a49c4adde2f3af26ed3ae1
      
https://github.com/qemu/qemu/commit/2a7e6857cd3178d705a49c4adde2f3af26ed3ae1
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M qapi-schema.json
    M ui/vnc.c

  Log Message:
  -----------
  ui: fix reporting of VNC auth in query-vnc-servers

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: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 4ee74fa7082a1a521dc5f7a4b61a62b61d1480b2
      
https://github.com/qemu/qemu/commit/4ee74fa7082a1a521dc5f7a4b61a62b61d1480b2
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-08 (Wed, 08 Feb 2017)

  Changed paths:
    M ui/vnc.c
    M ui/vnc.h

  Log Message:
  -----------
  ui: refactor VncDisplay to allow multiple listening sockets

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: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 275e0d616bc36f5e0ffa4eb5e28069d66e8e2137
      
https://github.com/qemu/qemu/commit/275e0d616bc36f5e0ffa4eb5e28069d66e8e2137
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M qemu-options.hx
    M ui/vnc.c

  Log Message:
  -----------
  ui: refactor code for populating SocketAddress from vnc_display_open

The code which interprets the CLI args to populate the SocketAddress
objects for plain & websockets VNC is quite complex already and will
need further enhancements shortly. Refactor it into separate methods
to avoid vnc_display_open getting even larger. As a side effect of
the refactoring, it is now possible to specify a listen address for
the websocket server explicitly. e.g,

  -vnc localhost:5900,websockets=0.0.0.0:8080

will listen on localhost for the plain VNC server, but expose the
websockets VNC server on the public interface. This refactoring
also removes the restriction that prevents enabling websockets
when the plain VNC server is listening on a UNIX socket.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden

[ kraxel: squashed clang build fix ]

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 8bd22f477f68bbd7a9c88e926e7a58bf65605e39
      
https://github.com/qemu/qemu/commit/8bd22f477f68bbd7a9c88e926e7a58bf65605e39
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  ui: extract code to connect/listen from vnc_display_open

The code which takes a SocketAddress and connects/listens on the
network is going to get more complicated to deal with multiple
listeners. Pull it out into a separate method to avoid making the
vnc_display_open method even more complex.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 57a6d6d538c596292003d131035dc4f7cb44474d
      
https://github.com/qemu/qemu/commit/57a6d6d538c596292003d131035dc4f7cb44474d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  ui: let VNC server listen on all resolved IP addresses

Remove the limitation that the VNC server can only listen on
a single resolved IP address. This uses the new DNS resolver
API to resolve a SocketAddress struct into an array of
SocketAddress structs containing raw IP addresses. The VNC
server will then attempt to listen on all resolved IP addresses.
The server must successfully listen on at least one of the
resolved IP addresses, otherwise an error will be reported.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: e998e2090fffe8083af381e41dc30a25e22fc28b
      
https://github.com/qemu/qemu/commit/e998e2090fffe8083af381e41dc30a25e22fc28b
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M include/qemu/option.h
    M util/qemu-option.c

  Log Message:
  -----------
  util: add iterators for QemuOpts values

To iterate over all QemuOpts currently requires using a callback
function which is inconvenient for control flow. Add support for
using iterator functions more directly

  QemuOptsIter iter;
  QemuOpt *opt;

  qemu_opts_iter_init(&iter, opts, "repeated-key");
  while ((opt = qemu_opts_iter_next(&iter)) != NULL) {
      ....do something...
  }

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 396f935a9aff3cefd288bdb2b20024fb9dcfa062
      
https://github.com/qemu/qemu/commit/396f935a9aff3cefd288bdb2b20024fb9dcfa062
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M ui/vnc.c

  Log Message:
  -----------
  ui: add ability to specify multiple VNC listen addresses

This change allows the listen address and websocket address
options for -vnc to be repeated. This causes the VNC server
to listen on multiple addresses. e.g.

 $ $QEMU -vnc vnc=localhost:1,vnc=unix:/tmp/vnc,\
        websocket=127.0.0.1:8080,websocket=[::]:8081

results in listening on

127.0.0.1:5901, 127.0.0.1:8080, ::1:5901, :::8081 & /tmp/vnc

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 8b1897725d07c02a55c06e1c1a885c5c17f15b0f
      
https://github.com/qemu/qemu/commit/8b1897725d07c02a55c06e1c1a885c5c17f15b0f
  Author: Peter Maydell <address@hidden>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M include/qemu/option.h
    M qapi-schema.json
    M qemu-options.hx
    M ui/vnc-jobs.c
    M ui/vnc-jobs.h
    M ui/vnc.c
    M ui/vnc.h
    M util/qemu-option.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170209-2' into 
staging

vnc: add support for multiple listening sockets.
vnc: misc fixes and cleanups.

# gpg: Signature made Thu 09 Feb 2017 16:45:02 GMT
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>"
# gpg:                 aka "Gerd Hoffmann <address@hidden>"
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/pull-ui-20170209-2:
  ui: add ability to specify multiple VNC listen addresses
  util: add iterators for QemuOpts values
  ui: let VNC server listen on all resolved IP addresses
  ui: extract code to connect/listen from vnc_display_open
  ui: refactor code for populating SocketAddress from vnc_display_open
  ui: refactor VncDisplay to allow multiple listening sockets
  ui: fix reporting of VNC auth in query-vnc-servers
  ui: fix regression handling bare 'websocket' option to -vnc
  vnc: do not disconnect on EAGAIN
  ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/f073cd3a2bf1...8b1897725d07

reply via email to

[Prev in Thread] Current Thread [Next in Thread]