Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloud-hypervisor/vsock): apply a workaround for notify sockets #297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/runners/cloud-hypervisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ let
vulkan = true;
};

# systemd>=256 hangs at stage-2 on notifying X_SYSTEMD_HOSTNAME
supportsNotifySocket =
builtins.compareVersions pkgs.systemd.version "256" < 0;
supportsNotifySocket = true;

in {
inherit tapMultiQueue;
Expand All @@ -110,7 +108,9 @@ in {

# Start socat to forward systemd notify socket over vsock
if [ -n "$NOTIFY_SOCKET" ]; then
${pkgs.socat}/bin/socat UNIX-LISTEN:notify.vsock_8888,fork UNIX-SENDTO:$NOTIFY_SOCKET &
# -T2 is required because cloud-hypervisor does not handle partial
# shutdown of the stream, like systemd v256+ does.
${pkgs.socat}/bin/socat -T2 UNIX-LISTEN:notify.vsock_8888,fork UNIX-SENDTO:$NOTIFY_SOCKET &
fi
'' + lib.optionalString graphics.enable ''
rm -f ${graphics.socket}
Expand Down