[pve-devel] [PATCH guest-common v3 10/22] vzdump: schema: make storage for fleecing semi-optional
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Apr 11 20:07:27 CEST 2024
On 11/04/2024 11:29, Fiona Ebner wrote:
> so it doesn't need to be set when explicitly disabling fleecing. Needs
> a custom verifier to enforce it being set when enabled.
>
> Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> src/PVE/VZDump/Common.pm | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/PVE/VZDump/Common.pm b/src/PVE/VZDump/Common.pm
> index 30bd044..f7cdb66 100644
> --- a/src/PVE/VZDump/Common.pm
> +++ b/src/PVE/VZDump/Common.pm
> @@ -95,8 +95,20 @@ PVE::JSONSchema::register_format('backup-fleecing', {
> description => "Use this storage to storage fleecing images. For efficient space usage, "
> ."it's best to use a local storage that supports discard and either thin provisioning "
> ."or sparse files.",
> + optional => 1,
> }),
> -});
> +}, \&verify_backup_fleecing);
> +
> +sub verify_backup_fleecing {
> + my ($param, $noerr) = @_;
> +
> + if (!$param->{storage} && $param->{enabled}) {
> + return if $noerr;
> + die "'storage' parameter is required when 'enabled' is set\n";
> + }
> +
> + return $param;
> +}
>
> PVE::JSONSchema::register_format('backup-performance', {
> 'max-workers' => {
More information about the pve-devel
mailing list