Skip to content

refactor: replace raw-byte sync protocol with typed message channel#188

Merged
ComixHe merged 7 commits into
OpenAtom-Linyaps:masterfrom
ComixHe:master
Jul 7, 2026
Merged

refactor: replace raw-byte sync protocol with typed message channel#188
ComixHe merged 7 commits into
OpenAtom-Linyaps:masterfrom
ComixHe:master

Conversation

@ComixHe

@ComixHe ComixHe commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

ComixHe added 3 commits July 6, 2026 18:49
fmt::format_to eliminates per-arg std::string allocation;
ioctl and prctl error messages use the new append_arg helper.

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
send, recv, sendmsg, recvmsg, connect all retry on EINTR.
Return errno-based result types with explicit operator bool.

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Comment thread src/linyaps_box/protocol/message.cpp Fixed
Comment thread src/linyaps_box/protocol/message.cpp Fixed
Comment thread src/linyaps_box/protocol/message.cpp Fixed
ComixHe added 4 commits July 7, 2026 14:08
… layer

New layering: os:: -> infra::unix_socket (SCM_RIGHTS) -> protocol::message_channel
(typed std::variant messages over SEQPACKET).

Consolidates old socket.h and unix_socket.h into purpose-built infra/protocol
modules with parent/child role separation and explicit wait_for stages.

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Replace raw-byte sync protocol with typed message_channel (parent/child roles):
- namespace/createruntime/createcontainer/exec handshakes -> stage enum
- console_fd travels over sync channel via SCM_RIGHTS (removes extra socketpair)
- exec_ready + close/die replaces STARTCONTAINER_HOOKS sentinel + raw close
- terminal_master::get() and terminal_slave::file_describer() -> fd()
- container_monitor param renamed from master to pty (fixes member shadowing)

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
Signed-off-by: Yuming He <ComixHe1895@outlook.com>
28 tests covering:
- serialize/deserialize wire format for all 5 message types
- fd transfer with SCM_RIGHTS (count and fstat validity)
- parent/child role semantics: wait_for, wait_for_exec phases, proceed handshake
- error paths: unknown msg_id, unknown stage type, empty fds, fd limit,
  report_error on closed socket

Signed-off-by: Yuming He <ComixHe1895@outlook.com>
@ComixHe ComixHe merged commit bef3f8d into OpenAtom-Linyaps:master Jul 7, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants