Short options for send so as to support older zfs versions

This commit is contained in:
Baldur Kristinsson 2023-02-05 16:03:13 +00:00 committed by DatuX
parent 60840a4213
commit 8b600c9e9c

View File

@ -575,13 +575,14 @@ class ZfsDataset:
# all kind of performance options: # all kind of performance options:
if 'large_blocks' in features and "-L" in self.zfs_node.supported_send_options: if 'large_blocks' in features and "-L" in self.zfs_node.supported_send_options:
cmd.append("--large-block") # large block support (only if recordsize>128k which is seldomly used) # large block support (only if recordsize>128k which is seldomly used)
cmd.append("-L") # --large-block
if write_embedded and 'embedded_data' in features and "-e" in self.zfs_node.supported_send_options: if write_embedded and 'embedded_data' in features and "-e" in self.zfs_node.supported_send_options:
cmd.append("--embed") # WRITE_EMBEDDED, more compact stream cmd.append("-e") # --embed; WRITE_EMBEDDED, more compact stream
if zfs_compressed and "-c" in self.zfs_node.supported_send_options: if zfs_compressed and "-c" in self.zfs_node.supported_send_options:
cmd.append("--compressed") # use compressed WRITE records cmd.append("-c") # --compressed; use compressed WRITE records
# raw? (send over encrypted data in its original encrypted form without decrypting) # raw? (send over encrypted data in its original encrypted form without decrypting)
if raw: if raw:
@ -589,8 +590,8 @@ class ZfsDataset:
# progress output # progress output
if show_progress: if show_progress:
cmd.append("--verbose") cmd.append("-v") # --verbose
cmd.append("--parsable") cmd.append("-P") # --parsable
# resume a previous send? (don't need more parameters in that case) # resume a previous send? (don't need more parameters in that case)
if resume_token: if resume_token:
@ -599,7 +600,7 @@ class ZfsDataset:
else: else:
# send properties # send properties
if send_properties: if send_properties:
cmd.append("--props") cmd.append("-p") # --props
# incremental? # incremental?
if prev_snapshot: if prev_snapshot: