[pve-devel] [PATCH installer] tui: multiply the disk size back into bytes

Stefan Sterz s.sterz at proxmox.com
Wed Jun 21 16:00:36 CEST 2023


previously the installer correctly divided the value when using them
for the `FloatEditView`, but forgot to multiply the value again when
retrieving it after editing. this commit fixes that

Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
tested this only locally and didn't build the installer completelly.
i am not sure if the installer handles this value correctly once it
is forwarded to the perl installer. if the perl installer expects
bytes here, it should work just fine, though.

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

diff --git a/proxmox-tui-installer/src/views/mod.rs b/proxmox-tui-installer/src/views/mod.rs
index 94c3993..8503d82 100644
--- a/proxmox-tui-installer/src/views/mod.rs
+++ b/proxmox-tui-installer/src/views/mod.rs
@@ -234,7 +234,7 @@ impl DiskSizeEditView {
                 .flatten()
         })
         .flatten()
-        .map(|val| val as u64)
+        .map(|val| (val * 1024. * 1024. * 1024.) as u64)
     }
 }
 
-- 
2.39.2






More information about the pve-devel mailing list