Skip to content

Simplify qemu shutdown script? #381

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
36 changes: 3 additions & 33 deletions lib/runners/qemu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -332,46 +332,16 @@ lib.warnIf (mem == 2048) ''
''
(
${writeQmp { execute = "qmp_capabilities"; }}
${writeQmp {
execute = "input-send-event";
arguments.events = [ {
type = "key";
data = {
down = true;
key = {
type = "qcode";
data = "ctrl";
};
};
} {
type = "key";
data = {
down = true;
key = {
type = "qcode";
data = "alt";
};
};
} {
type = "key";
data = {
down = true;
key = {
type = "qcode";
data = "delete";
};
};
} ];
}}
# wait for exit
${writeQmp { execute = "system_powerdown"; }}
# wait for exit
cat
) | \
${pkgs.socat}/bin/socat STDIO UNIX:${socket},shut-none
''
else throw "Cannot shutdown without socket";

setBalloonScript =
if socket != null
if socket != null && balloon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line shoud be changed in the other commit which probably should also be an extra commit.

then ''
VALUE=$(( $SIZE * 1024 * 1024 ))
SIZE=$( (
Expand Down