[pve-devel] [PATCH installer 1/2] Fix #2009: Recreate hdsize_adj with new hdsize
Stoiko Ivanov
s.ivanov at proxmox.com
Fri Dec 7 12:35:31 CET 2018
Creating $hdsize_size_adjustment once with a passed hdsize, breaks changing
the disk to a smaller/larger one, since the installer is stuck with the limits
set with the initial disk.
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
proxinstall | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/proxinstall b/proxinstall
index 9945dd1..159c727 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2501,11 +2501,13 @@ my $hdsize_entry_buffer;
my $get_hdsize_spinbtn = sub {
my $hdsize = shift;
- if (!defined($hdsize_size_adj)) {
- die "called get_hdsize_spinbtn with \$hdsize_size_adj not defined but did not pass hdsize!\n"
- if !defined($hdsize);
+ $hdsize_entry_buffer //= Gtk3::EntryBuffer->new(undef, 1);
+
+ if (defined($hdsize)) {
$hdsize_size_adj = Gtk3::Adjustment->new($config_options->{hdsize} || $hdsize, 0, $hdsize+1, 1, 1, 1);
- $hdsize_entry_buffer = Gtk3::EntryBuffer->new(undef, 1);
+ } else {
+ die "called get_hdsize_spinbtn with \$hdsize_size_adj not defined but did not pass hdsize!\n"
+ if !defined($hdsize_size_adj);
}
my $spinbutton_hdsize = Gtk3::SpinButton->new($hdsize_size_adj, 1, 1);
--
2.11.0
More information about the pve-devel
mailing list