From 37c104e4a84d48e15cb08a40cbb3ea7293120f71 Mon Sep 17 00:00:00 2001 From: Alp Celik Date: Sun, 2 Jun 2024 22:52:17 +0300 Subject: [PATCH] feat: Enable function for merging disks --- virtual_machine_config.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/virtual_machine_config.go b/virtual_machine_config.go index f2522d7..f42641d 100644 --- a/virtual_machine_config.go +++ b/virtual_machine_config.go @@ -114,3 +114,24 @@ func (vmc *VirtualMachineConfig) MergeIPConfigs() map[string]string { } return vmc.IPConfigs } + +func (vmc *VirtualMachineConfig) MergeDisks() map[string]string { + mergedDisks := make(map[string]string) + + for k, v := range vmc.MergeIDEs() { + mergedDisks[k] = v + } + + for k, v := range vmc.MergeSCSIs() { + mergedDisks[k] = v + } + + for k, v := range vmc.MergeSATAs() { + mergedDisks[k] = v + } + + for k, v := range vmc.MergeVirtIOs() { + mergedDisks[k] = v + } + return mergedDisks +}