From nobody Sat Apr 27 21:57:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=126.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522649974294924.5527451687924; Sun, 1 Apr 2018 23:19:34 -0700 (PDT) Received: from localhost ([::1]:35669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2soO-00062k-PK for importer@patchew.org; Mon, 02 Apr 2018 02:19:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2snM-0005bM-Qm for qemu-devel@nongnu.org; Mon, 02 Apr 2018 02:18:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2snJ-0006sP-K2 for qemu-devel@nongnu.org; Mon, 02 Apr 2018 02:18:20 -0400 Received: from m15-112.126.com ([220.181.15.112]:43578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2snI-0006p6-N4 for qemu-devel@nongnu.org; Mon, 02 Apr 2018 02:18:17 -0400 Received: from localhost.localdomain (unknown [58.213.111.46]) by smtp2 (Coremail) with SMTP id DMmowABH+vjcysFa39zMAQ--.22912S2; Mon, 02 Apr 2018 14:17:09 +0800 (CST) 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=NGAd/QtPdN0YIa5Ei6pycGc9hmEE2fV4tr +89dYhERa8vonEuU8H6U91cy9cL1JDNi3y9sJY5yhWRhd7xvpFqNScWLm6RX1R/L aZdKsI8ZJk7woEolepx+fwqCjL2Jy7fQ+FgnTb/5BBzB3TrtVNDeNyB8Ni8lGhfe dR1vBeV1U= From: Chen Hanxiao To: mdroth@linux.vnet.ibm.com Date: Mon, 2 Apr 2018 14:15:48 +0800 Message-Id: <20180402061548.29145-1-chen_han_xiao@126.com> X-Mailer: git-send-email 2.14.3 X-CM-TRANSID: DMmowABH+vjcysFa39zMAQ--.22912S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Aw4rXry3uw13ZF13Kw4kJFb_yoW8Xw4fpr ZxJr10kry8tF4kGr9xJ3W7XF18tFZ0vF1jgr98K34UAF9xJayFg39rKa4q9F1UZrs0kayF v3y0gF1rZw15Z37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UCYL9UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbitAUcrlpD5McI7QAAsc 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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_moun= tpoints, } =20 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 =3D=3D 0) { + ga_unset_frozen(ga_state); + } return i; =20 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 filesyst= ems -# 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 ## --=20 2.14.3