Skip to content

Commit

Permalink
guivm: fix crash on lid close
Browse files Browse the repository at this point in the history
Disables suspend inside gui-vm, as it causes qemu to segfault.
Related to: https://gitlab.com/qemu-project/qemu/-/issues/2321

Also brings in fix in vsockproxy, which didn't used to handle signals
gracefully, causing it to crash when the host is suspended.

Signed-off-by: Humaid Alqasimi <[email protected]>
  • Loading branch information
humaidq-tii authored and brianmcgillion committed Jun 24, 2024
1 parent 3d8f47c commit 70e53b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions modules/microvm/virtualization/microvm/guivm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
hostPlatform.system = configHost.nixpkgs.hostPlatform.system;
};

# Suspend inside Qemu causes segfault
# See: https://gitlab.com/qemu-project/qemu/-/issues/2321
services.logind.lidSwitch = "ignore";

microvm = {
optimize.enable = false;
vcpu = 2;
Expand Down Expand Up @@ -231,10 +235,10 @@ in {
systemd.services.vsockproxy = {
enable = true;
description = "vsockproxy";
unitConfig = {
Type = "simple";
};
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "1";
ExecStart = "${vsockproxy}/bin/vsockproxy ${toString cfg.waypipePort} ${toString cfg.vsockCID} ${toString cfg.waypipePort}";
};
wantedBy = ["multi-user.target"];
Expand Down
4 changes: 2 additions & 2 deletions packages/vsockproxy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ stdenv.mkDerivation {
src = fetchFromGitHub {
owner = "tiiuae";
repo = "vsockproxy";
rev = "aad625f9a27ce4c68d9996c65ece8477ace37534";
sha256 = "sha256-3WgpDlF8oIdlgwkvl7TPR6WAh+qk0mowzuYiPY0rwaU=";
rev = "851e995b4c24a776f78d56310010e4e29456921c";
sha256 = "sha256-fyawskwts4OIBshGDeh5ANeBCEm3h5AyHCyhwfxgP14=";
};

installPhase = ''
Expand Down

0 comments on commit 70e53b1

Please sign in to comment.