From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E213F92CD4 for ; Thu, 23 Mar 2023 12:03:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9DF5E2ABB6 for ; Thu, 23 Mar 2023 12:03:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 23 Mar 2023 12:03:10 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 73A744653F for ; Thu, 23 Mar 2023 12:03:09 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Thu, 23 Mar 2023 12:02:47 +0100 Message-Id: <20230323110248.344718-1-c.heiss@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.067 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH v3 manager 1/2] ui: qga: Add option to turn off QGA fs-freeze/-thaw on backup X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2023 11:03:43 -0000 Adds a default-on checkbox to the QEMU Guest Agent feature selector controlling the 'fs-freeze-on-backup' option. If unchecked, an additional warning is displayed that backups can potentially corrupt with this setting off. Signed-off-by: Christoph Heiss --- The qemu-server part has already been applied; commit 93e21fd. Changes v1 -> v2: * Rename option from 'fsfreeze_thaw' to 'freeze-fs-on-backup' * Adapt option descriptions as suggested Changes v2 -> v3: * Fold gettext() onto one line, as the parser does not support multiple lines (yet) * Change let -> const declaration www/manager6/Utils.js | 2 ++ www/manager6/form/AgentFeatureSelector.js | 30 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index d8c0bf5a..e6c7861a 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -475,6 +475,8 @@ Ext.define('PVE.Utils', { virtio: "VirtIO", }; displayText = map[value] || Proxmox.Utils.unknownText; + } else if (key === 'freeze-fs-on-backup' && PVE.Parser.parseBoolean(value)) { + continue; } else if (PVE.Parser.parseBoolean(value)) { displayText = Proxmox.Utils.enabledText; } diff --git a/www/manager6/form/AgentFeatureSelector.js b/www/manager6/form/AgentFeatureSelector.js index 0dcc6ecb..81ea42ea 100644 --- a/www/manager6/form/AgentFeatureSelector.js +++ b/www/manager6/form/AgentFeatureSelector.js @@ -21,6 +21,26 @@ Ext.define('PVE.form.AgentFeatureSelector', { }, disabled: true, }, + { + xtype: 'proxmoxcheckbox', + boxLabel: gettext('Freeze/thaw guest filesystems on backup for consistency'), + name: 'freeze-fs-on-backup', + reference: 'freeze_fs_on_backup', + bind: { + disabled: '{!enabled.checked}', + }, + disabled: true, + uncheckedValue: '0', + defaultValue: '1', + }, + { + xtype: 'displayfield', + userCls: 'pmx-hint', + value: gettext('Freeze/thaw for guest filesystems disabled. This can lead to inconsistent disk backups.'), + bind: { + hidden: '{freeze_fs_on_backup.checked}', + }, + }, { xtype: 'displayfield', userCls: 'pmx-hint', @@ -47,12 +67,20 @@ Ext.define('PVE.form.AgentFeatureSelector', { ], onGetValues: function(values) { - var agentstr = PVE.Parser.printPropertyString(values, 'enabled'); + if (PVE.Parser.parseBoolean(values['freeze-fs-on-backup'])) { + delete values['freeze-fs-on-backup']; + } + + const agentstr = PVE.Parser.printPropertyString(values, 'enabled'); return { agent: agentstr }; }, setValues: function(values) { let res = PVE.Parser.parsePropertyString(values.agent, 'enabled'); + if (!Ext.isDefined(res['freeze-fs-on-backup'])) { + res['freeze-fs-on-backup'] = 1; + } + this.callParent([res]); }, }); -- 2.39.2