[pve-devel] [PATCH installer 5/7] tui: add min/max contraints for LVM bootdisk parameters

Christoph Heiss c.heiss at proxmox.com
Wed Oct 4 16:42:16 CEST 2023


Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 proxmox-tui-installer/src/views/bootdisk.rs | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/proxmox-tui-installer/src/views/bootdisk.rs b/proxmox-tui-installer/src/views/bootdisk.rs
index 8b5b5d2..bb421a1 100644
--- a/proxmox-tui-installer/src/views/bootdisk.rs
+++ b/proxmox-tui-installer/src/views/bootdisk.rs
@@ -248,27 +248,34 @@ impl LvmBootdiskOptionsView {
         let view = FormView::new()
             .child(
                 "Total size",
-                DiskSizeEditView::new()
-                    .content(options.total_size)
-                    .max_value(options.total_size),
+                DiskSizeEditView::with_range(MINIMUM_DISK_SIZE, options.total_size)
+                    .content(options.total_size),
             )
             .child(
                 "Swap size",
-                DiskSizeEditView::new_emptyable().content_maybe(options.swap_size),
+                DiskSizeEditView::new_emptyable()
+                    .content_maybe(options.swap_size)
+                    .max_value(options.total_size),
             )
             .child_conditional(
                 is_pve,
                 "Maximum root volume size",
-                DiskSizeEditView::new_emptyable().content_maybe(options.max_root_size),
+                DiskSizeEditView::new_emptyable()
+                    .content_maybe(options.max_root_size)
+                    .max_value(options.total_size),
             )
             .child_conditional(
                 is_pve,
                 "Maximum data volume size",
-                DiskSizeEditView::new_emptyable().content_maybe(options.max_data_size),
+                DiskSizeEditView::new_emptyable()
+                    .content_maybe(options.max_data_size)
+                    .max_value(options.total_size),
             )
             .child(
                 "Minimum free LVM space",
-                DiskSizeEditView::new_emptyable().content_maybe(options.min_lvm_free),
+                DiskSizeEditView::new_emptyable()
+                    .content_maybe(options.min_lvm_free)
+                    .max_value(options.total_size),
             );
 
         Self { view }
-- 
2.42.0






More information about the pve-devel mailing list