Patchwork [2/2] guest-agent: only enable FSFREEZE when it's supported by the kernel

login
register
mail settings
Submitter Anthony Liguori
Date July 23, 2011, 9:26 p.m.
Message ID <1311456361-14162-2-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/106499/
State New
Headers show

Comments

Anthony Liguori - July 23, 2011, 9:26 p.m.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qga/guest-agent-commands.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
Michael Roth - July 23, 2011, 11:01 p.m.
On 07/23/2011 04:26 PM, Anthony Liguori wrote:
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
> ---
>   qga/guest-agent-commands.c |   12 +++++++-----
>   1 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
> index 624972e..30c4068 100644
> --- a/qga/guest-agent-commands.c
> +++ b/qga/guest-agent-commands.c
> @@ -10,15 +10,17 @@
>    * See the COPYING file in the top-level directory.
>    */
>
> -#if defined(__linux__)
> -#define CONFIG_FSFREEZE
> -#endif
> -
>   #include<glib.h>
> -#if defined(CONFIG_FSFREEZE)
> +
> +#if defined(__linux__)
>   #include<mntent.h>
>   #include<linux/fs.h>
> +
> +#if defined(__linux__)&&  defined(FIFREEZE)
> +#define CONFIG_FSFREEZE
>   #endif
> +#endif
> +
>   #include<sys/types.h>
>   #include<sys/ioctl.h>
>   #include "qga/guest-agent-core.h"

Much more sensible that the compile test I was doing :)

Patch

diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
index 624972e..30c4068 100644
--- a/qga/guest-agent-commands.c
+++ b/qga/guest-agent-commands.c
@@ -10,15 +10,17 @@ 
  * See the COPYING file in the top-level directory.
  */
 
-#if defined(__linux__)
-#define CONFIG_FSFREEZE
-#endif
-
 #include <glib.h>
-#if defined(CONFIG_FSFREEZE)
+
+#if defined(__linux__)
 #include <mntent.h>
 #include <linux/fs.h>
+
+#if defined(__linux__) && defined(FIFREEZE)
+#define CONFIG_FSFREEZE
 #endif
+#endif
+
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include "qga/guest-agent-core.h"