qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] chardev: postpone connect
@ 2025-10-14 15:26 Vladimir Sementsov-Ogievskiy
  2025-10-14 15:26 ` [PATCH v3 1/7] chardev/char-socket: simplify reconnect-ms handling Vladimir Sementsov-Ogievskiy
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2025-10-14 15:26 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: pbonzini, berrange, eduardo, qemu-devel, vsementsov, raphael,
	armbru, yc-core, d-tatianin

Hi all!

That's only a preparation for backend-transfer migration of
vhost-user-blk, and introduced DEFINE_PROP_CHR_NO_CONNECT()
is unused now.

v2 of "vhost-user-blk: live-backend local migration" is coming
soon, and will be based on this series (and will use
DEFINE_PROP_CHR_NO_CONNECT of course).

If the design gets general approval, I'll try to update other
chardev backends, to avoid supporting two different initialization
APIs in future.


Changes in v3:

01: add r-b by Marc-André
02: - rename function and save comment
    - add r-b by Marc-André
03: fix local_err to errp
04-06: add r-b by Marc-André
07: reworked to introduce DEFINE_PROP_CHR_NO_CONNECT


For backend-transfer migration we are going to pass
vhost-user-blk fds, including backend chardev fd to the target
in migration stream (backed by UNIX domain socket).

So, on the target, we want to know, should we call connect(),
or is it a backend-transfer migration, and we should wait for
incoming fd.

But at initialization time we can't know it: user may setup
migration parameters (enabling backend-transfer) later.

So, let's postpone chardev open/connect phase up to attaching
to frontend. At this point we can split the behavior:

If frontend is a device, which define chardev property
using DEFINE_PROP_CHR_NO_CONNECT (at least, vhost-user-blk will
behave this way soon), then do not connect(), let the device decide
when to do connect().

Otherwise (basic DEFINE_PROP_CHR, or other calls to qemu_chr_fe_init()),
do connect() at point of attaching frontend.

The series is based on
  [PATCH 0/2] remove deprecated 'reconnect' options
Based-on: <20250924133309.334631-1-vsementsov@yandex-team.ru>

Vladimir Sementsov-Ogievskiy (7):
  chardev/char-socket: simplify reconnect-ms handling
  chardev/char: split chardev_init_logfd() out of qemu_char_open()
  chardev/char: qemu_char_open(): add return value
  chardev/char: move filename and be_opened handling to qemu_char_open()
  chardev/char: introduce .init() + .connect() initialization interface
  chardev/char-socket: move to .init + .connect api
  chardev: introduce DEFINE_PROP_CHR_NO_CONNECT

 chardev/char-fe.c                   |  12 ++-
 chardev/char-socket.c               |  64 ++++++++-------
 chardev/char.c                      | 118 ++++++++++++++++++++--------
 hw/core/qdev-properties-system.c    |  26 +++++-
 include/chardev/char-fe.h           |   6 +-
 include/chardev/char-socket.h       |   1 +
 include/chardev/char.h              |  22 +++++-
 include/hw/qdev-properties-system.h |   3 +
 tests/unit/test-char.c              |  14 ++--
 ui/dbus-chardev.c                   |  12 ++-
 10 files changed, 203 insertions(+), 75 deletions(-)

-- 
2.48.1



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

end of thread, other threads:[~2025-10-15  8:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 15:26 [PATCH v3 0/7] chardev: postpone connect Vladimir Sementsov-Ogievskiy
2025-10-14 15:26 ` [PATCH v3 1/7] chardev/char-socket: simplify reconnect-ms handling Vladimir Sementsov-Ogievskiy
2025-10-14 15:26 ` [PATCH v3 2/7] chardev/char: split chardev_init_logfd() out of qemu_char_open() Vladimir Sementsov-Ogievskiy
2025-10-15  6:35   ` Markus Armbruster
2025-10-15  6:47     ` Vladimir Sementsov-Ogievskiy
2025-10-14 15:26 ` [PATCH v3 3/7] chardev/char: qemu_char_open(): add return value Vladimir Sementsov-Ogievskiy
2025-10-15  6:37   ` Markus Armbruster
2025-10-14 15:26 ` [PATCH v3 4/7] chardev/char: move filename and be_opened handling to qemu_char_open() Vladimir Sementsov-Ogievskiy
2025-10-14 15:26 ` [PATCH v3 5/7] chardev/char: introduce .init() + .connect() initialization interface Vladimir Sementsov-Ogievskiy
2025-10-15  6:50   ` Markus Armbruster
2025-10-15  6:58     ` Vladimir Sementsov-Ogievskiy
2025-10-15  7:49       ` Markus Armbruster
2025-10-14 15:26 ` [PATCH v3 6/7] chardev/char-socket: move to .init + .connect api Vladimir Sementsov-Ogievskiy
2025-10-14 15:26 ` [PATCH v3 7/7] chardev: introduce DEFINE_PROP_CHR_NO_CONNECT Vladimir Sementsov-Ogievskiy
2025-10-15  6:56   ` Markus Armbruster
2025-10-15  7:11     ` Vladimir Sementsov-Ogievskiy
2025-10-15  7:55       ` Markus Armbruster
2025-10-15  8:19         ` Vladimir Sementsov-Ogievskiy

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