* [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux
@ 2011-07-22 18:56 Blue Swirl
2011-07-22 19:10 ` Luiz Capitulino
2011-07-22 19:18 ` Anthony Liguori
0 siblings, 2 replies; 4+ messages in thread
From: Blue Swirl @ 2011-07-22 18:56 UTC (permalink / raw)
To: Michael Roth, Luiz Capitulino, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]
Fix build breakage on non-Linux hosts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
index 8c0d67e..918aaa2 100644
--- a/qga/guest-agent-commands.c
+++ b/qga/guest-agent-commands.c
@@ -11,10 +11,12 @@
*/
#include <glib.h>
-#include <mntent.h>
#include <sys/types.h>
#include <sys/ioctl.h>
+#ifdef __linux__
+#include <mntent.h>
#include <linux/fs.h>
+#endif
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
#include "qerror.h"
@@ -22,6 +24,7 @@
static GAState *ga_state;
+#ifdef __linux__
static void disable_logging(void)
{
ga_disable_logging(ga_state);
@@ -31,6 +34,7 @@ static void enable_logging(void)
{
ga_enable_logging(ga_state);
}
+#endif
/* Note: in some situations, like with the fsfreeze, logging may be
* temporarilly disabled. if it is necessary that a command be able
@@ -323,6 +327,7 @@ static void guest_file_init(void)
QTAILQ_INIT(&guest_file_state.filehandles);
}
+#ifdef __linux__
typedef struct GuestFsfreezeMount {
char *dirname;
char *devtype;
@@ -508,11 +513,29 @@ static void guest_fsfreeze_cleanup(void)
}
}
}
+#else
+GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
+{
+ return GUEST_FSFREEZE_STATUS_ERROR;
+}
+
+int64_t qmp_guest_fsfreeze_freeze(Error **err)
+{
+ return -1;
+}
+
+int64_t qmp_guest_fsfreeze_thaw(Error **err)
+{
+ return 0;
+}
+#endif
/* register init/cleanup routines for stateful command groups */
void ga_command_state_init(GAState *s, GACommandState *cs)
{
ga_state = s;
+#ifdef __linux__
ga_command_state_add(cs, guest_fsfreeze_init, guest_fsfreeze_cleanup);
+#endif
ga_command_state_add(cs, guest_file_init, NULL);
}
--
1.6.2.4
[-- Attachment #2: 0001-qga-fsfreeze-is-only-supported-on-Linux.patch --]
[-- Type: text/x-patch, Size: 2193 bytes --]
From 17d31722bd6cd92e414028f44e9b49238fe83bd4 Mon Sep 17 00:00:00 2001
Message-Id: <17d31722bd6cd92e414028f44e9b49238fe83bd4.1311360984.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Fri, 22 Jul 2011 18:53:46 +0000
Subject: [PATCH] qga: fsfreeze is only supported on Linux
Fix build breakage on non-Linux hosts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
index 8c0d67e..918aaa2 100644
--- a/qga/guest-agent-commands.c
+++ b/qga/guest-agent-commands.c
@@ -11,10 +11,12 @@
*/
#include <glib.h>
-#include <mntent.h>
#include <sys/types.h>
#include <sys/ioctl.h>
+#ifdef __linux__
+#include <mntent.h>
#include <linux/fs.h>
+#endif
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
#include "qerror.h"
@@ -22,6 +24,7 @@
static GAState *ga_state;
+#ifdef __linux__
static void disable_logging(void)
{
ga_disable_logging(ga_state);
@@ -31,6 +34,7 @@ static void enable_logging(void)
{
ga_enable_logging(ga_state);
}
+#endif
/* Note: in some situations, like with the fsfreeze, logging may be
* temporarilly disabled. if it is necessary that a command be able
@@ -323,6 +327,7 @@ static void guest_file_init(void)
QTAILQ_INIT(&guest_file_state.filehandles);
}
+#ifdef __linux__
typedef struct GuestFsfreezeMount {
char *dirname;
char *devtype;
@@ -508,11 +513,29 @@ static void guest_fsfreeze_cleanup(void)
}
}
}
+#else
+GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
+{
+ return GUEST_FSFREEZE_STATUS_ERROR;
+}
+
+int64_t qmp_guest_fsfreeze_freeze(Error **err)
+{
+ return -1;
+}
+
+int64_t qmp_guest_fsfreeze_thaw(Error **err)
+{
+ return 0;
+}
+#endif
/* register init/cleanup routines for stateful command groups */
void ga_command_state_init(GAState *s, GACommandState *cs)
{
ga_state = s;
+#ifdef __linux__
ga_command_state_add(cs, guest_fsfreeze_init, guest_fsfreeze_cleanup);
+#endif
ga_command_state_add(cs, guest_file_init, NULL);
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux
2011-07-22 18:56 [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux Blue Swirl
@ 2011-07-22 19:10 ` Luiz Capitulino
2011-07-22 19:18 ` Anthony Liguori
1 sibling, 0 replies; 4+ messages in thread
From: Luiz Capitulino @ 2011-07-22 19:10 UTC (permalink / raw)
To: Blue Swirl; +Cc: Michael Roth, qemu-devel
On Fri, 22 Jul 2011 21:56:39 +0300
Blue Swirl <blauwirbel@gmail.com> wrote:
> Fix build breakage on non-Linux hosts.
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Looks good to me.
This will return a command not found error, maybe unsupported is better,
but can be done later.
> ---
> qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++-
> 1 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
> index 8c0d67e..918aaa2 100644
> --- a/qga/guest-agent-commands.c
> +++ b/qga/guest-agent-commands.c
> @@ -11,10 +11,12 @@
> */
>
> #include <glib.h>
> -#include <mntent.h>
> #include <sys/types.h>
> #include <sys/ioctl.h>
> +#ifdef __linux__
> +#include <mntent.h>
> #include <linux/fs.h>
> +#endif
> #include "qga/guest-agent-core.h"
> #include "qga-qmp-commands.h"
> #include "qerror.h"
> @@ -22,6 +24,7 @@
>
> static GAState *ga_state;
>
> +#ifdef __linux__
> static void disable_logging(void)
> {
> ga_disable_logging(ga_state);
> @@ -31,6 +34,7 @@ static void enable_logging(void)
> {
> ga_enable_logging(ga_state);
> }
> +#endif
>
> /* Note: in some situations, like with the fsfreeze, logging may be
> * temporarilly disabled. if it is necessary that a command be able
> @@ -323,6 +327,7 @@ static void guest_file_init(void)
> QTAILQ_INIT(&guest_file_state.filehandles);
> }
>
> +#ifdef __linux__
> typedef struct GuestFsfreezeMount {
> char *dirname;
> char *devtype;
> @@ -508,11 +513,29 @@ static void guest_fsfreeze_cleanup(void)
> }
> }
> }
> +#else
> +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
> +{
> + return GUEST_FSFREEZE_STATUS_ERROR;
> +}
> +
> +int64_t qmp_guest_fsfreeze_freeze(Error **err)
> +{
> + return -1;
> +}
> +
> +int64_t qmp_guest_fsfreeze_thaw(Error **err)
> +{
> + return 0;
> +}
> +#endif
>
> /* register init/cleanup routines for stateful command groups */
> void ga_command_state_init(GAState *s, GACommandState *cs)
> {
> ga_state = s;
> +#ifdef __linux__
> ga_command_state_add(cs, guest_fsfreeze_init, guest_fsfreeze_cleanup);
> +#endif
> ga_command_state_add(cs, guest_file_init, NULL);
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux
2011-07-22 18:56 [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux Blue Swirl
2011-07-22 19:10 ` Luiz Capitulino
@ 2011-07-22 19:18 ` Anthony Liguori
2011-07-22 21:31 ` Blue Swirl
1 sibling, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2011-07-22 19:18 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel, Michael Roth, Luiz Capitulino
On 07/22/2011 01:56 PM, Blue Swirl wrote:
> Fix build breakage on non-Linux hosts.
>
> Signed-off-by: Blue Swirl<blauwirbel@gmail.com>
The patch I sent was similar but QAPI commands don't use in-band error
reporting so it set the out-of-band error.
I'll push my version if you can confirm it addresses the build issue.
Regards,
Anthony Liguori
> ---
> qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++-
> 1 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
> index 8c0d67e..918aaa2 100644
> --- a/qga/guest-agent-commands.c
> +++ b/qga/guest-agent-commands.c
> @@ -11,10 +11,12 @@
> */
>
> #include<glib.h>
> -#include<mntent.h>
> #include<sys/types.h>
> #include<sys/ioctl.h>
> +#ifdef __linux__
> +#include<mntent.h>
> #include<linux/fs.h>
> +#endif
> #include "qga/guest-agent-core.h"
> #include "qga-qmp-commands.h"
> #include "qerror.h"
> @@ -22,6 +24,7 @@
>
> static GAState *ga_state;
>
> +#ifdef __linux__
> static void disable_logging(void)
> {
> ga_disable_logging(ga_state);
> @@ -31,6 +34,7 @@ static void enable_logging(void)
> {
> ga_enable_logging(ga_state);
> }
> +#endif
>
> /* Note: in some situations, like with the fsfreeze, logging may be
> * temporarilly disabled. if it is necessary that a command be able
> @@ -323,6 +327,7 @@ static void guest_file_init(void)
> QTAILQ_INIT(&guest_file_state.filehandles);
> }
>
> +#ifdef __linux__
> typedef struct GuestFsfreezeMount {
> char *dirname;
> char *devtype;
> @@ -508,11 +513,29 @@ static void guest_fsfreeze_cleanup(void)
> }
> }
> }
> +#else
> +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
> +{
> + return GUEST_FSFREEZE_STATUS_ERROR;
> +}
> +
> +int64_t qmp_guest_fsfreeze_freeze(Error **err)
> +{
> + return -1;
> +}
> +
> +int64_t qmp_guest_fsfreeze_thaw(Error **err)
> +{
> + return 0;
> +}
> +#endif
>
> /* register init/cleanup routines for stateful command groups */
> void ga_command_state_init(GAState *s, GACommandState *cs)
> {
> ga_state = s;
> +#ifdef __linux__
> ga_command_state_add(cs, guest_fsfreeze_init, guest_fsfreeze_cleanup);
> +#endif
> ga_command_state_add(cs, guest_file_init, NULL);
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux
2011-07-22 19:18 ` Anthony Liguori
@ 2011-07-22 21:31 ` Blue Swirl
0 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-07-22 21:31 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, Michael Roth, Luiz Capitulino
On Fri, Jul 22, 2011 at 10:18 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 07/22/2011 01:56 PM, Blue Swirl wrote:
>>
>> Fix build breakage on non-Linux hosts.
>>
>> Signed-off-by: Blue Swirl<blauwirbel@gmail.com>
>
> The patch I sent was similar but QAPI commands don't use in-band error
> reporting so it set the out-of-band error.
Which patch?
> I'll push my version if you can confirm it addresses the build issue.
>
> Regards,
>
> Anthony Liguori
>
>> ---
>> qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++-
>> 1 files changed, 24 insertions(+), 1 deletions(-)
>>
>> diff --git a/qga/guest-agent-commands.c b/qga/guest-agent-commands.c
>> index 8c0d67e..918aaa2 100644
>> --- a/qga/guest-agent-commands.c
>> +++ b/qga/guest-agent-commands.c
>> @@ -11,10 +11,12 @@
>> */
>>
>> #include<glib.h>
>> -#include<mntent.h>
>> #include<sys/types.h>
>> #include<sys/ioctl.h>
>> +#ifdef __linux__
>> +#include<mntent.h>
>> #include<linux/fs.h>
>> +#endif
>> #include "qga/guest-agent-core.h"
>> #include "qga-qmp-commands.h"
>> #include "qerror.h"
>> @@ -22,6 +24,7 @@
>>
>> static GAState *ga_state;
>>
>> +#ifdef __linux__
>> static void disable_logging(void)
>> {
>> ga_disable_logging(ga_state);
>> @@ -31,6 +34,7 @@ static void enable_logging(void)
>> {
>> ga_enable_logging(ga_state);
>> }
>> +#endif
>>
>> /* Note: in some situations, like with the fsfreeze, logging may be
>> * temporarilly disabled. if it is necessary that a command be able
>> @@ -323,6 +327,7 @@ static void guest_file_init(void)
>> QTAILQ_INIT(&guest_file_state.filehandles);
>> }
>>
>> +#ifdef __linux__
>> typedef struct GuestFsfreezeMount {
>> char *dirname;
>> char *devtype;
>> @@ -508,11 +513,29 @@ static void guest_fsfreeze_cleanup(void)
>> }
>> }
>> }
>> +#else
>> +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
>> +{
>> + return GUEST_FSFREEZE_STATUS_ERROR;
>> +}
>> +
>> +int64_t qmp_guest_fsfreeze_freeze(Error **err)
>> +{
>> + return -1;
>> +}
>> +
>> +int64_t qmp_guest_fsfreeze_thaw(Error **err)
>> +{
>> + return 0;
>> +}
>> +#endif
>>
>> /* register init/cleanup routines for stateful command groups */
>> void ga_command_state_init(GAState *s, GACommandState *cs)
>> {
>> ga_state = s;
>> +#ifdef __linux__
>> ga_command_state_add(cs, guest_fsfreeze_init,
>> guest_fsfreeze_cleanup);
>> +#endif
>> ga_command_state_add(cs, guest_file_init, NULL);
>> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-22 21:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-22 18:56 [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux Blue Swirl
2011-07-22 19:10 ` Luiz Capitulino
2011-07-22 19:18 ` Anthony Liguori
2011-07-22 21:31 ` Blue Swirl
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).