qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] guest-agent: keep persistent state on persisten


From: Igor Mammedov
Subject: [Qemu-devel] [PATCH 1/2] guest-agent: keep persistent state on persistent storage
Date: Mon, 6 Oct 2014 07:44:50 +0000

GA was keepeing persistent state info in /var/run/qga.state
file. However it's lost after every reboot since /var/run
usually is located on tmpfs or cleaned on start-up.

Fix issue by keeping state file in /var/lib/qemu-ga/
directory, which is intended for keeping persistent
local state according to FHS.

Signed-off-by: Igor Mammedov <address@hidden>
---
 qga/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qga/main.c b/qga/main.c
index 227f2bd..5afba01 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -45,7 +45,8 @@
 
 #ifndef _WIN32
 #define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0"
-#define QGA_STATE_RELATIVE_DIR  "run"
+#define QGA_VOLATILE_STATE_RELATIVE_DIR  "run"
+#define QGA_STATE_RELATIVE_DIR  "lib/qemu-ga"
 #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0"
 #else
 #define QGA_VIRTIO_PATH_DEFAULT "\\\\.\\Global\\org.qemu.guest_agent.0"
@@ -121,7 +122,7 @@ init_dfl_pathnames(void)
     dfl_pathnames.state_dir = qemu_get_local_state_pathname(
       QGA_STATE_RELATIVE_DIR);
     dfl_pathnames.pidfile   = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid");
+      QGA_VOLATILE_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid");
 }
 
 static void quit_handler(int sig)
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]