[pve-devel] [PATCH v2 manager 2/3] ui: qga: Add option to turn off QGA fs-freeze/-thaw on backup

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Mar 21 13:31:44 CET 2023


Am 23/02/2023 um 15:18 schrieb Christoph Heiss:
> Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
> ---
> Changes v1 -> v2:
>  * Rename option from 'fsfreeze_thaw' to 'freeze-fs-on-backup'
>  * Adapt option descriptions as suggested
> 
>  www/manager6/Utils.js                     |  2 ++
>  www/manager6/form/AgentFeatureSelector.js | 31 ++++++++++++++++++++++-
>  2 files changed, 32 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..651b7124 100644
> --- a/www/manager6/form/AgentFeatureSelector.js
> +++ b/www/manager6/form/AgentFeatureSelector.js
> @@ -21,6 +21,27 @@ 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.'),

gettext need to be in a single line - or fix the "parser" that scans for the
messages in i18n ;-)

> +	    bind: {
> +		hidden: '{freeze_fs_on_backup.checked}',
> +	    },
> +	},
>  	{
>  	    xtype: 'displayfield',
>  	    userCls: 'pmx-hint',
> @@ -47,12 +68,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'];
> +	}
> +
> +	let 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.1
> 
> 
> 





More information about the pve-devel mailing list