qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] Fix socket chardev regression
@ 2018-08-17 13:52 Marc-André Lureau
  2018-08-17 13:52 ` [Qemu-devel] [PATCH 1/4] Revert "chardev: tcp: postpone TLS work until machine done" Marc-André Lureau
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Marc-André Lureau @ 2018-08-17 13:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, berrange, peterx, Marc-André Lureau

Hi,

In commit 25679e5d58e "chardev: tcp: postpone async connection setup"
(and its follow up 99f2f54174a59), Peter moved chardev socket
connection to machine_done event. However, chardev created later will
no longer attempt to connect, and chardev created in tests do not have
machine_done event (breaking some of vhost-user-test).

The goal was to move the "connect" source to the chardev frontend
context (the monitor thread context in his case). chr->gcontext is set
with qemu_chr_fe_set_handlers(). But there is no guarantee that the
function will be called in general, so we can't delay connection until
then: the chardev should still attempt to connect during open(), using
the main context.

An alternative would be to specify the iothread during chardev
creation. Setting up monitor OOB would be quite different too, it
would take the same iothread as argument.

99f2f54174a595e is also a bit problematic, since it will behave
differently before and after machine_done (the first case gives a
chance to use a different context reliably, the second looks racy)

In the end, I am not sure this is all necessary, as chardev callbacks
are called after qemu_chr_fe_set_handlers(), at which point the
context of sources are updated. In "char-socket: update all ioc
handlers when changing context", I moved also the hup handler to the
updated context. So unless the main thread is already stuck, we can
setup a different context for the chardev at that time. Or not?

Marc-André Lureau (4):
  Revert "chardev: tcp: postpone TLS work until machine done"
  Revert "chardev: tcp: postpone async connection setup"
  char-socket: update all ioc handlers when changing context
  test-char: add socket reconnect test

 chardev/char-socket.c | 86 ++++++++++++++++++-------------------------
 tests/test-char.c     | 18 +++++++--
 2 files changed, 50 insertions(+), 54 deletions(-)

-- 
2.18.0.547.g1d89318c48

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-08-22  6:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17 13:52 [Qemu-devel] [PATCH 0/4] Fix socket chardev regression Marc-André Lureau
2018-08-17 13:52 ` [Qemu-devel] [PATCH 1/4] Revert "chardev: tcp: postpone TLS work until machine done" Marc-André Lureau
2018-08-17 13:52 ` [Qemu-devel] [PATCH 2/4] Revert "chardev: tcp: postpone async connection setup" Marc-André Lureau
2018-08-17 13:52 ` [Qemu-devel] [PATCH 3/4] char-socket: update all ioc handlers when changing context Marc-André Lureau
2018-08-17 13:52 ` [Qemu-devel] [PATCH 4/4] test-char: add socket reconnect test Marc-André Lureau
2018-08-20  2:45 ` [Qemu-devel] [PATCH 0/4] Fix socket chardev regression Peter Xu
2018-08-20 15:37   ` Marc-André Lureau
2018-08-21  6:29     ` Peter Xu
2018-08-21 14:04       ` Marc-André Lureau
2018-08-21 14:14         ` Daniel P. Berrangé
2018-08-21 14:16         ` Paolo Bonzini
2018-08-22  3:46           ` Peter Xu
2018-08-22  6:55             ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).