From b8faa057d04b1398f5ce6ea663c077d00619bc22 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Wed, 9 Oct 2024 13:10:54 +0300 Subject: [PATCH] Add pluggable_memory_gb to QemuHCKDevice Signed-off-by: Kostiantyn Kostiuk --- lib/models/qemuhck_device.rb | 1 + lib/setupmanagers/qemuhck/qemu_machine.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/models/qemuhck_device.rb b/lib/models/qemuhck_device.rb index caaed740..30cb7806 100644 --- a/lib/models/qemuhck_device.rb +++ b/lib/models/qemuhck_device.rb @@ -15,6 +15,7 @@ class QemuHCKDevice < T::Struct const :pre_start_commands, T::Array[String], default: [] const :post_stop_commands, T::Array[String], default: [] const :machine_options, T::Array[String], default: [] + const :pluggable_memory_gb, Integer, default: 0 end end end diff --git a/lib/setupmanagers/qemuhck/qemu_machine.rb b/lib/setupmanagers/qemuhck/qemu_machine.rb index 05cfb3f6..996e6b2a 100644 --- a/lib/setupmanagers/qemuhck/qemu_machine.rb +++ b/lib/setupmanagers/qemuhck/qemu_machine.rb @@ -176,6 +176,13 @@ def initialize(options) @devices_list.flatten! @devices_list.compact! @device_infos = load_devices + process_device_options + end + + def process_device_options + @device_infos.each do |device_info| + @pluggable_memory_gb += device_info.pluggable_memory_gb + end end def define_local_variables