From patchwork Fri Jul 22 18:56:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 106379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 306B8B6F6F for ; Sat, 23 Jul 2011 04:57:12 +1000 (EST) Received: from localhost ([::1]:35039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkKuK-0003f5-L3 for incoming@patchwork.ozlabs.org; Fri, 22 Jul 2011 14:57:08 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkKuD-0003ey-BA for qemu-devel@nongnu.org; Fri, 22 Jul 2011 14:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkKuC-0005n3-6K for qemu-devel@nongnu.org; Fri, 22 Jul 2011 14:57:01 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:48945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkKuC-0005mu-19 for qemu-devel@nongnu.org; Fri, 22 Jul 2011 14:57:00 -0400 Received: by qyk30 with SMTP id 30so1625847qyk.4 for ; Fri, 22 Jul 2011 11:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=l8QTbVvYzb+BF4jIIqSCSlePvPDZI4L0YPjNp0TJ5Eo=; b=t4xJ82qeRJZuBUnrmNmiKabl4dbBF6N4MJFUaP92SGKNr7F/evmJbdT+bkw2M6QefW DYIl7I4qy2hvD2orhC3i9BeUXIHhMx+pR/bz1zP05bSD0Iw9HW4twi0UNjCr2ejYxjZS pVeX3pVbmN1u+jWVPY7eVlqCvH7IfzQPnUzbM= Received: by 10.224.195.1 with SMTP id ea1mr1542831qab.216.1311361019247; Fri, 22 Jul 2011 11:56:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.29.6 with HTTP; Fri, 22 Jul 2011 11:56:39 -0700 (PDT) From: Blue Swirl Date: Fri, 22 Jul 2011 21:56:39 +0300 Message-ID: To: Michael Roth , Luiz Capitulino , qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.180 Subject: [Qemu-devel] [PATCH] qga: fsfreeze is only supported on Linux X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix build breakage on non-Linux hosts. Signed-off-by: Blue Swirl --- qga/guest-agent-commands.c | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) From 17d31722bd6cd92e414028f44e9b49238fe83bd4 Mon Sep 17 00:00:00 2001 Message-Id: <17d31722bd6cd92e414028f44e9b49238fe83bd4.1311360984.git.blauwirbel@gmail.com> From: Blue Swirl 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 --- 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 -#include #include #include +#ifdef __linux__ +#include #include +#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