Skip to content

Commit

Permalink
QemuHCK: Fix missing iommu_device_param on device
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 committed Nov 7, 2024
1 parent 3ca5cc5 commit dd61c61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/models/qemuhck_device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class QemuHCKDevice < T::Struct
const :post_stop_commands, T::Array[String], default: []
const :machine_options, T::Array[String], default: []
const :pluggable_memory_gb, Integer, default: 0
const :iommu_device_param, T.nilable(String)
end
end
end
10 changes: 7 additions & 3 deletions lib/setupmanagers/qemuhck/qemu_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def define_local_variables
@device_commands = []
@machine_options = %w[@machine_name@]
@device_extra_param = []
@iommu_device_param = []
@cpu_options = %w[@cpu@ +x2apic +fsgsbase model=@cpu_model@]
@drive_cache_options = []
@define_variables = {}
Expand Down Expand Up @@ -322,7 +321,7 @@ def options_replacement_map
{
'@machine_options@' => (@machine_options + device_machine_options).join(','),
'@device_extra_param@' => @device_extra_param.join,
'@iommu_device_param@' => @iommu_device_param.join,
'@iommu_device_param@' => device_iommu_device_param.join,
'@cpu_options@' => @cpu_options.join(','),
'@drive_cache_options@' => @drive_cache_options.join
}
Expand Down Expand Up @@ -353,6 +352,11 @@ def device_machine_options
@device_infos.map(&:machine_options).flatten.compact
end

sig { returns(T::Array[String]) }
def device_iommu_device_param
@device_infos.filter_map(&:iommu_device_param)
end

def full_replacement_map
ReplacementMap.new({
'@run_id@' => @id,
Expand Down Expand Up @@ -400,7 +404,7 @@ def read_device(device)
end

def normalize_lists
[@device_commands, @machine_options, @device_extra_param, @iommu_device_param,
[@device_commands, @machine_options, @device_extra_param,
@cpu_options, @drive_cache_options].each do |arr|
arr.flatten!
arr.compact!
Expand Down

0 comments on commit dd61c61

Please sign in to comment.