Patchwork [3/3] qemu-ga: use state dir from CONFIG_QEMUGA_STATEDIR

login
register
mail settings
Submitter Luiz Capitulino
Date Oct. 3, 2012, 5:24 p.m.
Message ID <1349285059-5415-4-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/188863/
State New
Headers show

Comments

Luiz Capitulino - Oct. 3, 2012, 5:24 p.m.
Has the side effect of changing the default directory used to
save the freeze status file from /tmp to /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 should be cleaned on boot, this
    automatically cleans up any stale file

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qemu-ga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Michael Roth - Oct. 3, 2012, 6:20 p.m.
On Wed, Oct 03, 2012 at 02:24:19PM -0300, Luiz Capitulino wrote:
> Has the side effect of changing the default directory used to
> save the freeze status file from /tmp to /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 should be cleaned on boot, this
>     automatically cleans up any stale file
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>

Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>

> ---
>  qemu-ga.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qemu-ga.c b/qemu-ga.c
> index b747470..cbfd021 100644
> --- 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_PIDFILE_DEFAULT  CONFIG_QEMUGA_STATEDIR "/qemu-ga.pid"
> +#define QGA_STATEDIR_DEFAULT CONFIG_QEMUGA_STATEDIR
>  #define QGA_SENTINEL_BYTE 0xFF
> 
>  struct GAState {
> -- 
> 1.7.12.315.g682ce8b
> 
>

Patch

diff --git a/qemu-ga.c b/qemu-ga.c
index b747470..cbfd021 100644
--- 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_PIDFILE_DEFAULT  CONFIG_QEMUGA_STATEDIR "/qemu-ga.pid"
+#define QGA_STATEDIR_DEFAULT CONFIG_QEMUGA_STATEDIR
 #define QGA_SENTINEL_BYTE 0xFF
 
 struct GAState {