[pve-devel] [PATCH installer] tui: bootdisk zfs config: add a maximum value to the `copies` option

Stefan Sterz s.sterz at proxmox.com
Fri Nov 17 17:32:18 CET 2023


according to `man zfsprops` the copies option can only be 1, 2, or 3.
limit the field to 3, as setting higher options can't work anyway.

Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
i would have added a `min_value` of 1 too, but `IntegerEditView` is
based on `NumericEditView` and that doesn't offer a minimal value.

 proxmox-tui-installer/src/views/bootdisk.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-tui-installer/src/views/bootdisk.rs b/proxmox-tui-installer/src/views/bootdisk.rs
index 00e6ade..7e13e91 100644
--- a/proxmox-tui-installer/src/views/bootdisk.rs
+++ b/proxmox-tui-installer/src/views/bootdisk.rs
@@ -592,7 +592,7 @@ impl ZfsBootdiskOptionsView {
                             .unwrap_or_default(),
                     ),
             )
-            .child("copies", IntegerEditView::new().content(options.copies))
+            .child("copies", IntegerEditView::new().content(options.copies).max_value(3))
             .child_conditional(
                 is_pve,
                 "ARC max size",
--
2.39.2






More information about the pve-devel mailing list