From b0401f34a1865c00bc4fb632582c43234c6d2f21 Mon Sep 17 00:00:00 2001
From: iliya <iliya.saroukhanian@etu.hesge.ch>
Date: Sun, 17 Mar 2024 21:57:19 +0100
Subject: [PATCH] feat: shutting down VM after writing to file

---
 qga_comms.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qga_comms.sh b/qga_comms.sh
index d502d6d..5573169 100755
--- a/qga_comms.sh
+++ b/qga_comms.sh
@@ -38,3 +38,6 @@ close_file_cmd=$(jq -n --argjson int_handle "$int_handle" \
 echo "Closing $file_path ($file_handle)..."
 
 { echo $close_file_cmd; sleep 1; } | socat unix-connect:/tmp/qga.sock - > /dev/null
+
+echo "Shutting down VM..."
+{ echo '{"execute":"guest-shutdown"}'; sleep 1; } | socat unix-connect:/tmp/qga.sock -
-- 
GitLab