qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux
Date: Fri, 22 Jul 2011 16:10:40 -0300	[thread overview]
Message-ID: <20110722161040.28f3dd7f@doriath> (raw)
In-Reply-To: <CAAu8pHvsOdYB=zbdeOgadmNdVjQ5wdGod_trQVsQdriLmbyB_g@mail.gmail.com>

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);
>  }

  reply	other threads:[~2011-07-22 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 18:56 [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux Blue Swirl
2011-07-22 19:10 ` Luiz Capitulino [this message]
2011-07-22 19:18 ` Anthony Liguori
2011-07-22 21:31   ` Blue Swirl

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=20110722161040.28f3dd7f@doriath \
    --to=lcapitulino@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=mdroth@linux.vnet.ibm.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).