[pve-devel] [PATCH v2 guest-common 1/3] vzdump.conf: make pigz a property string

Moayad Almalat m.almalat at proxmox.com
Tue Feb 4 15:56:01 CET 2020


From: Moayad <m.almalat at proxmox.com>

and add blocksize property.

Signed-off-by: Moayad <m.almalat at proxmox.com>
---
 PVE/VZDump/Common.pm | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/PVE/VZDump/Common.pm b/PVE/VZDump/Common.pm
index 4789a50..0ee7aba 100644
--- a/PVE/VZDump/Common.pm
+++ b/PVE/VZDump/Common.pm
@@ -60,6 +60,21 @@ sub parse_dow {
     return $res;
 };
 
+my $pigzdesc = {
+    threads => {
+	type => "integer",
+	description => "Use pigz instead of gzip when N>0.".
+	    " N=1 uses half of cores, N>1 uses N as thread count.",
+	default => 0,
+	default_key => 1,
+    },
+    blocksize => {
+	type => "integer",
+	description => "blocksize for compression with pigz",
+	optional => 1,
+    },
+};
+
 my $confdesc = {
     vmid => {
 	type => 'string', format => 'pve-vmid-list',
@@ -92,11 +107,10 @@ my $confdesc = {
 	default => '0',
     },
     pigz=> {
-	type => "integer",
-	description => "Use pigz instead of gzip when N>0.".
-	    " N=1 uses half of cores, N>1 uses N as thread count.",
+	type => 'string',
+	description => "pigz settings.",
+	format => $pigzdesc,
 	optional => 1,
-	default => 0,
     },
     quiet => {
 	type => 'boolean',
@@ -220,6 +234,10 @@ sub get_confdesc {
     return $confdesc;
 }
 
+sub get_pigzdesc {
+    return $pigzdesc;
+}
+
 # add JSON properties for create and set function
 sub json_config_properties {
     my $prop = shift;
-- 
2.20.1




More information about the pve-devel mailing list