Skip to content

Commit

Permalink
Never try to reuse partitions if any DASD is involved (bsc#983003)
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Jul 4, 2016
1 parent 262db77 commit 5358f93
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/modules/StorageProposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4514,6 +4514,24 @@ def modify(partitions)

end

# Check if a disk is a DASD.
#
# @param [String] disk_name device name of the disk
# @return [bool] true if it is a DASD, false if not
#
def is_dasd?(disk_name)
return false if disk_name.nil?
disk_name.start_with?("/dev/dasd")
end

# Check if any disk in a string array is a DASD.
#
# @param [Array<String>] disk_names device names of the disks
# @return [bool] true if any of them is a DASD, false if not
#
def any_dasd?(disk_names)
disk_names.any? { |disk| is_dasd?(disk) }
end

def get_inst_proposal(target)
target = deep_copy(target)
Expand All @@ -4537,6 +4555,10 @@ def get_inst_proposal(target)
target = prepare_part_lists(ddev, target)
mode = :free
while mode != :end && Builtins.size(sol_disk) == 0
if any_dasd?(ddev) && mode == :reuse
log.info("Skipping reuse mode for DASD")
mode = :desperate # bsc#983003
end
if mode == :free || mode == :desperate
valid = Builtins.listmap(ddev) { |s| { s => true } }
if mode == :desperate
Expand Down

0 comments on commit 5358f93

Please sign in to comment.