Skip to content

Commit

Permalink
Fix interaction between FADUMP and auto resize
Browse files Browse the repository at this point in the history
If FADUMP is enabled, then the crashkernel area is reserved by the
firmware and it cannot be resized. Make sure that the Auto Resize
checkbox is always disabled if FADUMP is active.
  • Loading branch information
Petr Tesarik committed Feb 4, 2022
1 parent f9bfbb3 commit 08a152b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/include/kdump/uifunctions.rb
Expand Up @@ -1344,7 +1344,12 @@ def update_usable_memory
# Function initializes option
# "KdumpMemory"
def InitKdumpMemory(_key)
auto_resize = Kdump.KDUMP_SETTINGS["KDUMP_AUTO_RESIZE"] == "yes"
if Kdump.using_fadump?
UI.ChangeWidget(Id(:auto_resize), :Enabled, false)
auto_resize = false
else
auto_resize = Kdump.KDUMP_SETTINGS["KDUMP_AUTO_RESIZE"] == "yes"
end
UI.ChangeWidget(Id(:auto_resize), :Value, auto_resize)
if Kdump.total_memory > 0
UI.ChangeWidget(Id(:allocated_memory_box), :Enabled, !auto_resize)
Expand Down Expand Up @@ -1454,6 +1459,14 @@ def HandleFADump(_key, event)
UI.ChangeWidget(Id("use_fadump"), :Value, false)
end

value = UI.QueryWidget(Id("use_fadump"), :Value)
if value
UI.ChangeWidget(Id(:auto_resize), :Value, false)
UI.ChangeWidget(Id(:allocated_memory_box), :Enabled, true)
update_usable_memory
end
UI.ChangeWidget(Id(:auto_resize), :Enabled, !value)

nil
end

Expand Down

0 comments on commit 08a152b

Please sign in to comment.