Loading src/balloon.sh +9 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,9 @@ set -Eeuo pipefail : "${BALLOONING:="N"}" : "${BALLOONING_DEBUG:="N"}" : "${BALLOONING_PID:="$QEMU_DIR/balloon.pid"}" rm -f "$BALLOONING_PID" [[ "$BALLOONING" != [Yy1]* ]] && return 0 # By default, the VM is allocated the full amount of RAM configured via RAM_SIZE for its entire lifetime, but if you want Loading @@ -30,7 +32,7 @@ set -Eeuo pipefail # Warning: if the container memory limit is reduced at runtime below the guest VM's current memory usage, the container # may be killed by the OOM killer if the ballooning driver cannot reclaim memory from the guest fast enough. ballooning() { balloon() { # Wait for qemu PID file to be created while [ ! -f "$QEMU_PID" ]; do Loading @@ -54,12 +56,16 @@ ballooning() { BALLOON_ARGS+=(--debug "$BALLOONING_DEBUG") fi python3 ./balloon.py --qmp-sock "$QEMU_DIR/qemu-qmp-ballooning.sock" --qemu-pid-file "$QEMU_PID" "${BALLOON_ARGS[@]}" python3 ./balloon.py --qmp-sock "$QEMU_DIR/qemu-qmp-ballooning.sock" --qemu-pid-file "$QEMU_PID" "${BALLOON_ARGS[@]}" & local pid="$!" echo "$pid" > "$BALLOONING_PID" wait "$pid" rm -f -- "$BALLOONING_PID" } msg="Starting memory ballooning monitor..." info "$msg" ( ballooning ) & ( balloon ) & return 0 src/power.sh +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ finish() { local i=0 local pid="" local reason=$1 local pids=( "$TPM_PID" "$WSD_PID" "$WEB_PID" "$PASST_PID" "$DNSMASQ_PID" ) local pids=( "$TPM_PID" "$WSD_PID" "$WEB_PID" "$PASST_PID" "$DNSMASQ_PID" "${BALLOONING_PID:-}" ) touch "$QEMU_END" (( reason != 0 )) && (( reason != 143 )) && echo "QEMU exitcode: $reason" Loading Loading
src/balloon.sh +9 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,9 @@ set -Eeuo pipefail : "${BALLOONING:="N"}" : "${BALLOONING_DEBUG:="N"}" : "${BALLOONING_PID:="$QEMU_DIR/balloon.pid"}" rm -f "$BALLOONING_PID" [[ "$BALLOONING" != [Yy1]* ]] && return 0 # By default, the VM is allocated the full amount of RAM configured via RAM_SIZE for its entire lifetime, but if you want Loading @@ -30,7 +32,7 @@ set -Eeuo pipefail # Warning: if the container memory limit is reduced at runtime below the guest VM's current memory usage, the container # may be killed by the OOM killer if the ballooning driver cannot reclaim memory from the guest fast enough. ballooning() { balloon() { # Wait for qemu PID file to be created while [ ! -f "$QEMU_PID" ]; do Loading @@ -54,12 +56,16 @@ ballooning() { BALLOON_ARGS+=(--debug "$BALLOONING_DEBUG") fi python3 ./balloon.py --qmp-sock "$QEMU_DIR/qemu-qmp-ballooning.sock" --qemu-pid-file "$QEMU_PID" "${BALLOON_ARGS[@]}" python3 ./balloon.py --qmp-sock "$QEMU_DIR/qemu-qmp-ballooning.sock" --qemu-pid-file "$QEMU_PID" "${BALLOON_ARGS[@]}" & local pid="$!" echo "$pid" > "$BALLOONING_PID" wait "$pid" rm -f -- "$BALLOONING_PID" } msg="Starting memory ballooning monitor..." info "$msg" ( ballooning ) & ( balloon ) & return 0
src/power.sh +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ finish() { local i=0 local pid="" local reason=$1 local pids=( "$TPM_PID" "$WSD_PID" "$WEB_PID" "$PASST_PID" "$DNSMASQ_PID" ) local pids=( "$TPM_PID" "$WSD_PID" "$WEB_PID" "$PASST_PID" "$DNSMASQ_PID" "${BALLOONING_PID:-}" ) touch "$QEMU_END" (( reason != 0 )) && (( reason != 143 )) && echo "QEMU exitcode: $reason" Loading