Do not handle the unix socket server in-place

Let the code after that actually run..
This commit is contained in:
Val Packett 2025-11-14 06:09:05 -03:00
parent 52ad012e13
commit fa0bf056d0

View file

@ -165,6 +165,7 @@ async fn main() -> eyre::Result<()> {
if let Some(path) = cli.unix_path { if let Some(path) = cli.unix_path {
// XXX: going through the channel just to strip fds // XXX: going through the channel just to strip fds
let vm_unix_listener = UnixListener::bind(path)?; let vm_unix_listener = UnixListener::bind(path)?;
server_tasks.spawn(enclose! { (vm_bus, vm_bus_guid) async move {
while let Ok((socket, remote_addr)) = vm_unix_listener.accept().await { while let Ok((socket, remote_addr)) = vm_unix_listener.accept().await {
let f = enclose! { (vm_bus, vm_bus_guid) async move { let f = enclose! { (vm_bus, vm_bus_guid) async move {
let client_conn = zbus::connection::Builder::unix_stream(socket) let client_conn = zbus::connection::Builder::unix_stream(socket)
@ -188,6 +189,7 @@ async fn main() -> eyre::Result<()> {
.instrument(info_span!("serve", ?remote_addr)), .instrument(info_span!("serve", ?remote_addr)),
); );
} }
} });
} }
if let Some(port) = cli.vsock_port { if let Some(port) = cli.vsock_port {
@ -217,7 +219,6 @@ async fn main() -> eyre::Result<()> {
.iter_mut() .iter_mut()
.map(|child| child.wait()) .map(|child| child.wait())
.collect::<FuturesUnordered<_>>(); .collect::<FuturesUnordered<_>>();
debug!("starting..");
tokio::select! { tokio::select! {
_ = server_tasks.join_all() => debug!("server tasks ended"), _ = server_tasks.join_all() => debug!("server tasks ended"),
res = waiter.next() => debug!(?res, "child process terminated"), res = waiter.next() => debug!(?res, "child process terminated"),