From patchwork Tue May 29 10:50:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Hanxiao X-Patchwork-Id: 921983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=126.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=126.com header.i=@126.com header.b="fwFKbiiG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40w9qw2qHrz9s08 for ; Tue, 29 May 2018 21:05:32 +1000 (AEST) Received: from localhost ([::1]:60160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcRV-0004ku-Vv for incoming@patchwork.ozlabs.org; Tue, 29 May 2018 07:05:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDZ-0001oc-DQ for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcDU-0004Dx-IV for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:05 -0400 Received: from m15-112.126.com ([220.181.15.112]:57068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDT-0004AX-LQ for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=QeiFPW6IUAV2/7E1FU OWUgZ8VHQSxBUiCBroGRupLJM=; b=fwFKbiiGLE5ArHHq72hksMiWgR3oMNKYb4 vWDtX91wM8B3YH2EEYHWpIBdYW35KUdgS19RtSogeOcNm+3F+H9RJgUlybek4bR4 LBMnWlGkrsqjj1LhlZpzj1k/3NrgNDZsUukAhjnds6DVl4wqjqwyHERemZmoquFj aCbFY2VUA= Received: from localhost.localdomain (unknown [58.213.111.46]) by smtp2 (Coremail) with SMTP id DMmowAB3zqZ8MA1bs7qTBw--.5439S2; Tue, 29 May 2018 18:50:52 +0800 (CST) From: Chen Hanxiao To: mdroth@linux.vnet.ibm.com Date: Tue, 29 May 2018 18:50:36 +0800 Message-Id: <20180529105036.13466-1-chen_han_xiao@126.com> X-Mailer: git-send-email 2.17.0 X-CM-TRANSID: DMmowAB3zqZ8MA1bs7qTBw--.5439S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Aw4rXry3uw13ZF13Kw4kJFb_yoW8Xw4fpr ZxJr10kry8tF4kGr9xJ3W7XF18tFZ0vF1jgr98K34UAF9xJayFg39rKa4q9F1UZrs0kayF v3y0gF1rZw15Z37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jUZ2-UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbiaAxVrlpD5t5RUwAAs8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 220.181.15.112 Subject: [Qemu-devel] [PATCH resend v2] qga: unset frozen state if no mount points are frozen X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Chen Hanxiao Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Chen Hanxiao If we set mountpoints to qmp_guest_fsfreeze_freeze_list, we may got nothing to freeze as all mountpoints are not valid. So call ga_unset_frozen in this senario. Also, if we return 0 frozen fs, there is no need to call guest-fsfreeze-thaw. Cc: Michael Roth Signed-off-by: Chen Hanxiao --- v2: remove has_mountpoints special case add qapi-schema.json section qga/commands-posix.c | 6 ++++++ qga/qapi-schema.json | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 0dc219dbcf..93bfc5b4ab 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -1274,6 +1274,12 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints, } free_fs_mount_list(&mounts); + /* We may not issue any FIFREEZE here. + * Just unset ga_state here and ready for the next call. + */ + if (i == 0) { + ga_unset_frozen(ga_state); + } return i; error: diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 17884c7c70..1045cef386 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -435,7 +435,9 @@ # for up to 10 seconds by VSS. # # Returns: Number of file systems currently frozen. On error, all filesystems -# will be thawed. +# will be thawed. If no filesystems are frozen as a result of this call, +# then @guest-fsfreeze-status will remain "thawed" and calling +# @guest-fsfreeze-thaw is not necessary. # # Since: 0.15.0 ##