qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] chardev: fix mess in OPENED/CLOSED events when muxed
@ 2018-11-05 12:45 Artem Pisarenko
  2018-11-05 12:45 ` [Qemu-devel] [PATCH v2 1/2] " Artem Pisarenko
  2018-11-05 12:45 ` [Qemu-devel] [PATCH v2 2/2] tests/test-char: add muxed chardev testing for open/close Artem Pisarenko
  0 siblings, 2 replies; 6+ messages in thread
From: Artem Pisarenko @ 2018-11-05 12:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Marc-André Lureau, Artem Pisarenko

This issue actually more complex. Idea of generating events from inside function called '*_set_handlers' isn't good, at least its implicit nature, and especially a fact, that function decides about open state (see 'fe_open' variable), but generates event only in one direction. Combined with 'mux_chr_set_handlers()' hack this makes things even worse.
Better solution is to change fe interface and rewrite all frontends code (a lot of stuff in hw/char/* and somewhere else).
Although first patch doesn't fix any bug (known to me), its main effect is optimization of emulation performance by avoiding extra activity.
Added testing demonstrates issue and prevents potential bugs in future.

v2 changes:
 - fix failed unit test
 - 'mux_chr_set_handlers()' hack rewritten (as supposed by Marc-André Lureau)
 - added testing of issue to unit test (new patch)

Artem Pisarenko (2):
  chardev: fix mess in OPENED/CLOSED events when muxed
  tests/test-char: add muxed chardev testing for open/close

 chardev/char-fe.c         | 33 +++++++++++++------
 chardev/char-mux.c        | 16 +++++-----
 include/chardev/char-fe.h | 18 ++++++++++-
 tests/test-char.c         | 80 +++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 127 insertions(+), 20 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-11-06 12:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05 12:45 [Qemu-devel] [PATCH v2 0/2] chardev: fix mess in OPENED/CLOSED events when muxed Artem Pisarenko
2018-11-05 12:45 ` [Qemu-devel] [PATCH v2 1/2] " Artem Pisarenko
2018-11-06 11:35   ` Marc-André Lureau
2018-11-05 12:45 ` [Qemu-devel] [PATCH v2 2/2] tests/test-char: add muxed chardev testing for open/close Artem Pisarenko
2018-11-06 11:22   ` Marc-André Lureau
2018-11-06 12:46     ` Artem Pisarenko

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).