From: Artem Pisarenko <artem.k.pisarenko@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Artem Pisarenko" <artem.k.pisarenko@gmail.com>
Subject: [Qemu-devel] [PATCH v2 0/2] chardev: fix mess in OPENED/CLOSED events when muxed
Date: Mon, 5 Nov 2018 18:45:08 +0600 [thread overview]
Message-ID: <cover.1541421653.git.artem.k.pisarenko@gmail.com> (raw)
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
next reply other threads:[~2018-11-05 12:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 12:45 Artem Pisarenko [this message]
2018-11-05 12:45 ` [Qemu-devel] [PATCH v2 1/2] chardev: fix mess in OPENED/CLOSED events when muxed 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1541421653.git.artem.k.pisarenko@gmail.com \
--to=artem.k.pisarenko@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).