From 7b4b471d5af80bdedfae5f36ce46f20da4f0d63a Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 16 Sep 2024 23:10:41 +0200 Subject: [PATCH] Flock: misc --- flock/flock.c | 6 ++++++ flock/hypervisor.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/flock/flock.c b/flock/flock.c index 78619003..39c4e484 100644 --- a/flock/flock.c +++ b/flock/flock.c @@ -1,6 +1,7 @@ #include "flock/flock.h" #include "lib/obstacle.h" +#include "lib/runtime.h" #include "lib/string.h" #include "lib/timer.h" #include "sysdep/unix/unix.h" @@ -11,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -160,6 +162,10 @@ main(int argc, char **argv, char **argh UNUSED) birdloop_init(); + struct global_runtime gr = *atomic_load_explicit(&global_runtime, memory_order_relaxed); +// gr.latency_debug = ~0; + switch_runtime(&gr); + ev_init_list(&global_event_list, &main_birdloop, "Global event list"); ev_init_list(&global_work_list, &main_birdloop, "Global work list"); ev_init_list(&main_birdloop.event_list, &main_birdloop, "Global fast event list"); diff --git a/flock/hypervisor.c b/flock/hypervisor.c index 2fa701c9..9df38cdc 100644 --- a/flock/hypervisor.c +++ b/flock/hypervisor.c @@ -196,6 +196,13 @@ hypervisor_exposed_parent_rx(sock *sk, uint size UNUSED) }; int e = recvmsg(sk->fd, &m, 0); + if (e < 3) + { + log(L_ERR "Exposed parent RX hangup, what the hell"); + sk_close(sk); + ev_send_loop(&main_birdloop, &poweroff_event); + return 0; + } struct cmsghdr *c = CMSG_FIRSTHDR(&m); memcpy(&sfd, CMSG_DATA(c), sizeof sfd);