From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: lersek@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] guest-agent: keep persistent state on persistent storage
Date: Mon, 6 Oct 2014 07:44:50 +0000 [thread overview]
Message-ID: <1412581491-31656-2-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1412581491-31656-1-git-send-email-imammedo@redhat.com>
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 <imammedo@redhat.com>
---
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
next prev parent reply other threads:[~2014-10-06 7:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 7:44 [Qemu-devel] [PATCH 0/2] guest-agent: make CPU's online/offline state persistent Igor Mammedov
2014-10-06 7:44 ` Igor Mammedov [this message]
2014-10-06 9:25 ` [Qemu-devel] [PATCH 1/2] guest-agent: keep persistent state on persistent storage Laszlo Ersek
2014-10-06 7:44 ` [Qemu-devel] [PATCH 2/2] guest-agent: preserve online/offline state of VCPUs on guest reboot Igor Mammedov
2014-10-06 9:46 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412581491-31656-2-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).