]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
qemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 3 Oct 2012 21:35:58 +0000 (18:35 -0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Oct 2012 08:40:14 +0000 (03:40 -0500)
Has the side effect of changing the default directory used to
save the freeze status file from /tmp to ${prefix}/var/run.

This is a beneficial change for two reasons:

  1. FHS states that programs must not assume that files in /tmp will
     still exist between invocations of the program. This defeats
 the purpose of the freeze status file

  2. FHS dictates that /var/run must be cleaned on boot, this
     ensures that a stale freeze status file will be removed on boot

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qemu-ga.c

index b7474708f0fc4157163d45cf0060762b0aa8ce88..daeaea54619dafc3c3302d9cdf4de8e65dc2ed1f 100644 (file)
--- a/qemu-ga.c
+++ b/qemu-ga.c
@@ -40,8 +40,8 @@
 #else
 #define QGA_VIRTIO_PATH_DEFAULT "\\\\.\\Global\\org.qemu.guest_agent.0"
 #endif
-#define QGA_PIDFILE_DEFAULT "/var/run/qemu-ga.pid"
-#define QGA_STATEDIR_DEFAULT "/tmp"
+#define QGA_STATEDIR_DEFAULT CONFIG_QEMU_LOCALSTATEDIR "/run"
+#define QGA_PIDFILE_DEFAULT QGA_STATEDIR_DEFAULT "/qemu-ga.pid"
 #define QGA_SENTINEL_BYTE 0xFF
 
 struct GAState {