qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7a9657: chardev: fix mess in OPENED/CLOSED ev


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 7a9657: chardev: fix mess in OPENED/CLOSED events when muxed
Date: Thu, 14 Feb 2019 07:20:03 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7a9657ef5307e769f084bd9f7e20ebe1ee6ac044
      
https://github.com/qemu/qemu/commit/7a9657ef5307e769f084bd9f7e20ebe1ee6ac044
  Author: Artem Pisarenko <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-fe.c
    M chardev/char-mux.c
    M include/chardev/char-fe.h

  Log Message:
  -----------
  chardev: fix mess in OPENED/CLOSED events when muxed

When chardev is multiplexed (mux=on) there are a lot of cases where
CHR_EVENT_OPENED/CHR_EVENT_CLOSED events pairing (expected from
frontend side) is broken. There are either generation of multiple
repeated or extra CHR_EVENT_OPENED events, or CHR_EVENT_CLOSED just
isn't generated at all.
This is mostly because 'qemu_chr_fe_set_handlers()' function makes its
own (and often wrong) implicit decision on updated frontend state and
invokes 'fd_event' callback with 'CHR_EVENT_OPENED'. And even worse,
it doesn't do symmetric action in opposite direction, as someone may
expect (i.e. it doesn't invoke previously set 'fd_event' with
'CHR_EVENT_CLOSED'). Muxed chardev uses trick by calling this function
again to replace callback handlers with its own ones, but it doesn't
account for such side effect.
Fix that using extended version of this function with added argument
for disabling side effect and keep original function for compatibility
with lots of frontends already using this interface and being
"tolerant" to its side effects.
One more source of event duplication is just line of code in
char-mux.c, which does far more than comment above says (obvious fix).

Signed-off-by: Artem Pisarenko <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 68cf36a7ea49ba5c66fe6205de0ab85931e46a2e
      
https://github.com/qemu/qemu/commit/68cf36a7ea49ba5c66fe6205de0ab85931e46a2e
  Author: Artem Pisarenko <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M tests/test-char.c

  Log Message:
  -----------
  tests/test-char: add muxed chardev testing for open/close

Validate that frontend callbacks for CHR_EVENT_OPENED/CHR_EVENT_CLOSED
events are being issued when expected and in strictly pairing order.

Signed-off-by: Artem Pisarenko <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 52d6cfeca29734904ce589c00028347b7fa9cfd9
      
https://github.com/qemu/qemu/commit/52d6cfeca29734904ce589c00028347b7fa9cfd9
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M io/task.c

  Log Message:
  -----------
  io: store reference to thread information in the QIOTask struct

Currently the struct QIOTaskThreadData is only needed by the worker
thread, but a subsequent patch will need to access it from another
context.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: dbb44504c28683a4428308f72b9f61733fcda007
      
https://github.com/qemu/qemu/commit/dbb44504c28683a4428308f72b9f61733fcda007
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M include/io/task.h
    M io/task.c
    M io/trace-events

  Log Message:
  -----------
  io: add qio_task_wait_thread to join with a background thread

Add the ability for a caller to wait for completion of the
background thread to synchronously dispatch its result, without
needing to wait for the main loop to run the idle callback.

This method needs very careful usage to avoid a dangerous
race condition with the free'ing of the task. The completion
callback is normally invoked from an idle callback registered
with the main loop context. The qio_task_wait_thread method
must only be called if the completion callback has not yet
run. The only safe way to achieve this is to run the
qio_task_wait_thread method from the thread that executes
the main loop.

It is generally a bad idea to use this method since it will
block execution of the main loop, however, the design of
the character devices and its usage from vhostuser already
requires blocking execution.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 1645984b04fd8597ccdfc6e8530fd17d23f4cdf0
      
https://github.com/qemu/qemu/commit/1645984b04fd8597ccdfc6e8530fd17d23f4cdf0
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: fix validation of options for QMP created chardevs

The TLS creds option is not valid with certain address types. The user
config was only checked for errors when parsing legacy QemuOpts, thus
the user could pass unsupported values via QMP.

Pull all code for validating options out into a new method
qmp_chardev_validate_socket, that is called from the main
qmp_chardev_open_socket method. This adds a missing check for rejecting
TLS creds with the vsock address type.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 4a0582f65648052bf6b1b572312500f6647a1eb0
      
https://github.com/qemu/qemu/commit/4a0582f65648052bf6b1b572312500f6647a1eb0
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: forbid 'reconnect' option with server sockets

The 'reconnect' option is used to give the sleep time, in seconds,
before a client socket attempts to re-establish a connection to the
server. It does not make sense to set this for server sockets, as they
will always accept a new client connection immediately after the
previous one went away.

Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 767abe7f49e8be14d29da5db3527817b5d696a52
      
https://github.com/qemu/qemu/commit/767abe7f49e8be14d29da5db3527817b5d696a52
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c
    M tests/ivshmem-test.c
    M tests/libqtest.c
    M tests/test-filter-redirector.c

  Log Message:
  -----------
  chardev: forbid 'wait' option with client sockets

The 'wait'/'nowait' parameter is used to tell server sockets whether to
block until a client is accepted during initialization. Client chardevs
have always silently ignored this option. Various tests were mistakenly
passing this option for their client chardevs.

Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 5981c3a2326a1eb758bd6b950c1471e19f77d3f0
      
https://github.com/qemu/qemu/commit/5981c3a2326a1eb758bd6b950c1471e19f77d3f0
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: remove many local variables in qemu_chr_parse_socket

Now that all validation is separated off into a separate method,
we can directly populate the ChardevSocket struct from the
QemuOpts values, avoiding many local variables.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 0bf62dc89ecb43f2fb0850f938d692024eb8ec52
      
https://github.com/qemu/qemu/commit/0bf62dc89ecb43f2fb0850f938d692024eb8ec52
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char.c
    M tests/test-char.c

  Log Message:
  -----------
  chardev: ensure qemu_chr_parse_compat reports missing driver error

If no valid char driver was identified the qemu_chr_parse_compat method
was silent, leaving callers no clue what failed.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: e154fd7991872980a07069b45b5bea8af9acb282
      
https://github.com/qemu/qemu/commit/e154fd7991872980a07069b45b5bea8af9acb282
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: remove unused 'sioc' variable & cleanup paths

The 'sioc' variable in qmp_chardev_open_socket was unused since

  commit 3e7d4d20d3a528b1ed10b1dc3d83119bfb0c5f24
  Author: Peter Xu <address@hidden>
  Date:   Tue Mar 6 13:33:17 2018 +0800

    chardev: use chardev's gcontext for async connect

Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: efae0b9202f1acf04b958abb9c6b8431a60521ff
      
https://github.com/qemu/qemu/commit/efae0b9202f1acf04b958abb9c6b8431a60521ff
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: split tcp_chr_wait_connected into two methods

The tcp_chr_wait_connected method can deal with either server or client
chardevs, but some callers only care about one of these possibilities.
The tcp_chr_wait_connected method will also need some refactoring to
reliably deal with its primary goal of allowing a device frontend to
wait for an established connection, which will interfere with other
callers.

Split it into two methods, one responsible for server initiated
connections, the other responsible for client initiated connections.
In doing this split the tcp_char_connect_async() method is renamed
to become consistent with naming of the new methods.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: b5e18e51498a7867b7a540221e8dac17911446af
      
https://github.com/qemu/qemu/commit/b5e18e51498a7867b7a540221e8dac17911446af
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: split up qmp_chardev_open_socket connection code

In qmp_chardev_open_socket the code for connecting client chardevs is
split across two conditionals far apart with some server chardev code in
the middle. Split up the method so that code for client connection setup
is separate from code for server connection setup.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 32423ccaa1fb4d4777dbc4e3e3da331a1616a489
      
https://github.com/qemu/qemu/commit/32423ccaa1fb4d4777dbc4e3e3da331a1616a489
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: use a state machine for socket connection state

The socket connection state is indicated via the 'bool connected' field
in the SocketChardev struct. This variable is somewhat misleading
though, as it is only set to true once the connection has completed all
required handshakes (eg for TLS, telnet or websockets). IOW there is a
period of time in which the socket is connected, but the "connected"
flag is still false.

The socket chardev really has three states that it can be in,
disconnected, connecting and connected and those should be tracked
explicitly.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 25d93b6a116fcef9b4c7c7dcea2fab90dd7c88b5
      
https://github.com/qemu/qemu/commit/25d93b6a116fcef9b4c7c7dcea2fab90dd7c88b5
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: honour the reconnect setting in tcp_chr_wait_connected

If establishing a client connection fails, the tcp_chr_wait_connected
method should sleep for the reconnect timeout and then retry the
attempt. This ensures the callers don't immediately abort with an
error when the initial connection fails.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: d1885e549d16103f57df5306f3dd53c626a10d05
      
https://github.com/qemu/qemu/commit/d1885e549d16103f57df5306f3dd53c626a10d05
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected

In the previous commit

    commit 1dc8a6695c731abb7461c637b2512c3670d82be4
    Author: Marc-André Lureau <address@hidden>
    Date:   Tue Aug 16 12:33:32 2016 +0400

      char: fix waiting for TLS and telnet connection

the tcp_chr_wait_connected() method was changed to check for a non-NULL
's->ioc' as a sign that there is already a connection present, as
opposed to checking the "connected" flag to supposedly fix handling of
TLS/telnet connections.

The original code would repeatedly call tcp_chr_wait_connected creating
many connections as 'connected' would never become true. The changed
code would still repeatedly call tcp_chr_wait_connected busy waiting
because s->ioc is set but the chardev will never see CHR_EVENT_OPENED.
IOW, the code is still broken with TLS/telnet, but in a different way.

Checking for a non-NULL 's->ioc' does not mean that a CHR_EVENT_OPENED
will be ready for a TLS/telnet connection. These protocols (and the
websocket protocol) all require the main loop to be running in order
to complete the protocol handshake before emitting CHR_EVENT_OPENED.
The tcp_chr_wait_connected() method is only used during early startup
before a main loop is running, so TLS/telnet/websock connections can
never complete initialization.

Making this work would require changing tcp_chr_wait_connected to run
a main loop. This is quite complex since we must not allow GSource's
that other parts of QEMU have registered to run yet. The current callers
of tcp_chr_wait_connected do not require use of the TLS/telnet/websocket
protocols, so the simplest option is to just forbid this combination
completely for now.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 4b47373a0d9a77e5a2099fd4b8d7d03b75523a36
      
https://github.com/qemu/qemu/commit/4b47373a0d9a77e5a2099fd4b8d7d03b75523a36
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: fix race with client connections in tcp_chr_wait_connected

When the 'reconnect' option is given for a client connection, the
qmp_chardev_open_socket_client method will run an asynchronous
connection attempt. The QIOChannel socket executes this is a single use
background thread, so the connection will succeed immediately (assuming
the server is listening). The chardev, however, won't get the result
from this background thread until the main loop starts running and
processes idle callbacks.

Thus when tcp_chr_wait_connected is run s->ioc will be NULL, but the
state will be TCP_CHARDEV_STATE_CONNECTING, and there may already
be an established connection that will be associated with the chardev
by the pending idle callback. tcp_chr_wait_connected doesn't check the
state, only s->ioc, so attempts to establish another connection
synchronously.

If the server allows multiple connections this is unhelpful but not a
fatal problem as the duplicate connection will get ignored by the
tcp_chr_new_client method when it sees the state is already connected.

If the server only supports a single connection, however, the
tcp_chr_wait_connected method will hang forever because the server will
not accept its synchronous connection attempt until the first connection
is closed.

To deal with this tcp_chr_wait_connected needs to synchronize with the
completion of the background connection task. To do this it needs to
create the QIOTask directly and use the qio_task_wait_thread method.
This will cancel the pending idle callback and directly dispatch the
task completion callback, allowing the connection to be associated
with the chardev. If the background connection failed, it can still
attempt a new synchronous connection.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 9baa6802fe55ea83dc8723bd7efcf633992a3e15
      
https://github.com/qemu/qemu/commit/9baa6802fe55ea83dc8723bd7efcf633992a3e15
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M tests/test-char.c

  Log Message:
  -----------
  tests: expand coverage of socket chardev test

The current socket chardev tests try to exercise the chardev socket
driver in both server and client mode at the same time. The chardev API
is not very well designed to handle both ends of the connection being in
the same process so this approach makes the test case quite unpleasant
to deal with.

This splits the tests into distinct cases, one to test server socket
chardevs and one to test client socket chardevs. In each case the peer
is run in a background thread using the simpler QIOChannelSocket APIs.
The main test case code can now be written in a way that mirrors the
typical usage from within QEMU.

In doing this recfactoring it is possible to greatly expand the test
coverage for the socket chardevs to test all combinations except for a
server operating in blocking wait mode.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 211ef6c4b6297a6275015c16b76bc72de35c56c3
      
https://github.com/qemu/qemu/commit/211ef6c4b6297a6275015c16b76bc72de35c56c3
  Author: Daniel P. Berrangé <address@hidden>
  Date:   2019-02-12 (Tue, 12 Feb 2019)

  Changed paths:
    M chardev/char-serial.c

  Log Message:
  -----------
  chardev: ensure termios is fully initialized

valgrind on the test-char.c code reports that 'struct termios' contains
uninitialized memory.

Signed-off-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 4ad6f6cb149b03ab9399a63208918cde09248294
      
https://github.com/qemu/qemu/commit/4ad6f6cb149b03ab9399a63208918cde09248294
  Author: Paolo Bonzini <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M chardev/char.c
    M gdbstub.c
    M hmp.c
    M hw/arm/omap2.c
    M hw/bt/hci-csr.c
    M hw/char/omap_uart.c
    M hw/char/xen_console.c
    M hw/isa/isa-superio.c
    M hw/mips/boston.c
    M hw/mips/mips_malta.c
    M hw/usb/dev-serial.c
    M include/chardev/char.h
    M net/slirp.c
    M qtest.c
    M tests/test-char.c
    M tests/vhost-user-test.c
    M vl.c

  Log Message:
  -----------
  char: allow specifying a GMainContext at opening time

This will be needed by vhost-user-test, when each test switches to
its own GMainLoop and GMainContext.  Otherwise, for a reconnecting
socket the initial connection will happen on the default GMainContext,
and no one will be listening on it.

Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 129263c6c08407747753c0c1f715917107cbcb3f
      
https://github.com/qemu/qemu/commit/129263c6c08407747753c0c1f715917107cbcb3f
  Author: Philippe Mathieu-Daudé <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M chardev/wctablet.c

  Log Message:
  -----------
  chardev/wctablet: Fix a typo

The correct name is Wacom.
Fix the typo which is present since 378af96155d.

Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 3d9e232240f9d029d7255b5b11d3a2f61c53d0d0
      
https://github.com/qemu/qemu/commit/3d9e232240f9d029d7255b5b11d3a2f61c53d0d0
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M chardev/char-fe.c
    M chardev/char-mux.c
    M include/chardev/char-mux.h

  Log Message:
  -----------
  char: update the mux handlers in class callback

Instead of handling mux chardev in a special way in
qemu_chr_fe_set_handlers(), we may use the chr_update_read_handler
class callback instead.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: b1f1103dbabb5f47c3fc7081d8b7edeca1fdf334
      
https://github.com/qemu/qemu/commit/b1f1103dbabb5f47c3fc7081d8b7edeca1fdf334
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M hw/char/terminal3270.c

  Log Message:
  -----------
  terminal3270: do not use backend timer sources

terminal3270 uses the front-end side of the chardev. It shouldn't
create sources from backend side context (with backend
functions).

send_timing_mark_cb calls qemu_chr_fe_write_all() which should be
thread safe.

This partially reverts changes from commit
2c716ba1506769c9be2caa02f0f6d6e7c00f4304.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: 64c3f266dd14d62886b4a51f6bfce49ac14620fa
      
https://github.com/qemu/qemu/commit/64c3f266dd14d62886b4a51f6bfce49ac14620fa
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M include/chardev/char-fe.h

  Log Message:
  -----------
  chardev: add a note about frontend sources and context switch

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: f8278c7d74c6b92b3dbbd6636d6e8917d6050378
      
https://github.com/qemu/qemu/commit/f8278c7d74c6b92b3dbbd6636d6e8917d6050378
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M chardev/char-pty.c

  Log Message:
  -----------
  char-pty: remove the check for connection on write

This doesn't help much compared to the 1 second poll PTY
timer. I can't think of a use case where this would help.

However, we can simplify the code around chr_write(): the write lock
is no longer needed for other char-pty callbacks (see following
patch).

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: f7ea2038bea04628eaa55156fc34edf9d0c4a2bb
      
https://github.com/qemu/qemu/commit/f7ea2038bea04628eaa55156fc34edf9d0c4a2bb
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-02-13 (Wed, 13 Feb 2019)

  Changed paths:
    M chardev/char-pty.c

  Log Message:
  -----------
  char-pty: remove write_lock usage

The lock usage was described with its introduction in commit
9005b2a7589540a3733b3abdcfbccfe7746cd1a1. It was necessary because PTY
write() shares more state than GIOChannel with other
operations.

This made char-pty a bit different from other chardev, that only lock
around the write operation.  This was apparent in commit
7b3621f47a990c5099c6385728347f69a8d0e55c, which introduced an idle
source to avoid the lock.

By removing the PTY chardev state sharing on write() with previous
patch, we can remove the lock and the idle source.

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>


  Commit: c4c5f6573a93dfbd351c41a27ea29a662d7445fa
      
https://github.com/qemu/qemu/commit/c4c5f6573a93dfbd351c41a27ea29a662d7445fa
  Author: Peter Maydell <address@hidden>
  Date:   2019-02-14 (Thu, 14 Feb 2019)

  Changed paths:
    M chardev/char-fe.c
    M chardev/char-mux.c
    M chardev/char-pty.c
    M chardev/char-serial.c
    M chardev/char-socket.c
    M chardev/char.c
    M chardev/wctablet.c
    M gdbstub.c
    M hmp.c
    M hw/arm/omap2.c
    M hw/bt/hci-csr.c
    M hw/char/omap_uart.c
    M hw/char/terminal3270.c
    M hw/char/xen_console.c
    M hw/isa/isa-superio.c
    M hw/mips/boston.c
    M hw/mips/mips_malta.c
    M hw/usb/dev-serial.c
    M include/chardev/char-fe.h
    M include/chardev/char-mux.h
    M include/chardev/char.h
    M include/io/task.h
    M io/task.c
    M io/trace-events
    M net/slirp.c
    M qtest.c
    M tests/ivshmem-test.c
    M tests/libqtest.c
    M tests/test-char.c
    M tests/test-filter-redirector.c
    M tests/vhost-user-test.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/elmarco/tags/chardev-pull-request' into 
staging

Chardev fixes

# gpg: Signature made Wed 13 Feb 2019 16:18:36 GMT
# gpg:                using RSA key DAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <address@hidden>" [full]
# gpg:                 aka "Marc-André Lureau <address@hidden>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/chardev-pull-request: (25 commits)
  char-pty: remove write_lock usage
  char-pty: remove the check for connection on write
  chardev: add a note about frontend sources and context switch
  terminal3270: do not use backend timer sources
  char: update the mux handlers in class callback
  chardev/wctablet: Fix a typo
  char: allow specifying a GMainContext at opening time
  chardev: ensure termios is fully initialized
  tests: expand coverage of socket chardev test
  chardev: fix race with client connections in tcp_chr_wait_connected
  chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected
  chardev: honour the reconnect setting in tcp_chr_wait_connected
  chardev: use a state machine for socket connection state
  chardev: split up qmp_chardev_open_socket connection code
  chardev: split tcp_chr_wait_connected into two methods
  chardev: remove unused 'sioc' variable & cleanup paths
  chardev: ensure qemu_chr_parse_compat reports missing driver error
  chardev: remove many local variables in qemu_chr_parse_socket
  chardev: forbid 'wait' option with client sockets
  chardev: forbid 'reconnect' option with server sockets
  ...

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


Compare: https://github.com/qemu/qemu/compare/4856c2c70c87...c4c5f6573a93



reply via email to

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