From patchwork Thu Apr 19 12:10:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CB9D7B6FF5 for ; Thu, 19 Apr 2012 22:11:03 +1000 (EST) Received: from localhost ([::1]:59318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKqCT-00022x-Jd for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2012 08:11:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKqCI-00022b-NP for qemu-devel@nongnu.org; Thu, 19 Apr 2012 08:10:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKqCC-0006WS-DM for qemu-devel@nongnu.org; Thu, 19 Apr 2012 08:10:50 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:46722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKqCC-0006WK-6J for qemu-devel@nongnu.org; Thu, 19 Apr 2012 08:10:44 -0400 Received: by ghrr14 with SMTP id r14so5584337ghr.4 for ; Thu, 19 Apr 2012 05:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=NArx6wLYksAqXLen5qPlbOd6CnpO7KTBkw/v3iGoB+Y=; b=jozydN4gp0/3kR7UtX7aHvqKbcGP7n1LmYfGfm28mIlUSXya1gkFUgbyI6Wi2ZRb8X ECRg/JZEW0PcwvDNVJHH4ImtH0d11sWDCDnorekAxA/VAvcEVXWA4se9vvB0PRN1fgl3 VkTSOAIIf/vPQ0hjjktYPCUJjVAAHUVDYJzdtbGgrfkD7xCoQmyGdPyoB1QgXvgUjfab EzHNp+AlDkbbVnKDb5O5DSaM7obFbQjODNxRN5CokVNmko5m7PkW/g352lesIMveDBu4 PuSIsKsRiULlTkIVrIm1clJSa+OxZuPW/PLBk5iM8gG187TV7zYwJtjHoiNM+jaAUHoK QDSg== Received: by 10.50.106.132 with SMTP id gu4mr16687112igb.59.1334837440727; Thu, 19 Apr 2012 05:10:40 -0700 (PDT) Received: from pebble.com ([12.236.175.36]) by mx.google.com with ESMTPS id a10sm24301193igj.10.2012.04.19.05.10.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 05:10:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 19 Apr 2012 07:10:14 -0500 Message-Id: <1334837414-30510-1-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.173 Cc: Michael Roth , Luiz Capitulino Subject: [Qemu-devel] [PATCH] qmp: Care for linux without fsfreeze 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 Debian 5.0.8 does not define FIFREEZE. Disentangle CONFIG_FSFREEZE from __linux__. Signed-off-by: Richard Henderson Cc: Luiz Capitulino Cc: Michael Roth --- qga/commands-posix.c | 48 ++++++++++++++++++++++-------------------------- 1 files changed, 22 insertions(+), 26 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index faf970d..83b400d 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -312,8 +312,6 @@ static void guest_file_init(void) } /* linux-specific implementations. avoid this if at all possible. */ -#if defined(__linux__) - #if defined(CONFIG_FSFREEZE) static void disable_logging(void) @@ -511,8 +509,30 @@ static void guest_fsfreeze_cleanup(void) } } } +#else /* defined(CONFIG_FSFREEZE) */ +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err) +{ + error_set(err, QERR_UNSUPPORTED); + + return 0; +} + +int64_t qmp_guest_fsfreeze_freeze(Error **err) +{ + error_set(err, QERR_UNSUPPORTED); + + return 0; +} + +int64_t qmp_guest_fsfreeze_thaw(Error **err) +{ + error_set(err, QERR_UNSUPPORTED); + + return 0; +} #endif /* CONFIG_FSFREEZE */ +#if defined(__linux__) #define LINUX_SYS_STATE_FILE "/sys/power/state" #define SUSPEND_SUPPORTED 0 #define SUSPEND_NOT_SUPPORTED 1 @@ -878,30 +898,7 @@ error: qapi_free_GuestNetworkInterfaceList(head); return NULL; } - #else /* defined(__linux__) */ - -GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err) -{ - error_set(err, QERR_UNSUPPORTED); - - return 0; -} - -int64_t qmp_guest_fsfreeze_freeze(Error **err) -{ - error_set(err, QERR_UNSUPPORTED); - - return 0; -} - -int64_t qmp_guest_fsfreeze_thaw(Error **err) -{ - error_set(err, QERR_UNSUPPORTED); - - return 0; -} - void qmp_guest_suspend_disk(Error **err) { error_set(err, QERR_UNSUPPORTED); @@ -922,7 +919,6 @@ GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp) error_set(errp, QERR_UNSUPPORTED); return NULL; } - #endif /* register init/cleanup routines for stateful command groups */