From 215b6c1cd08a8743314218f35c05898740dcc3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alp=20Eren=20=C3=87elik?= <80721144+alperencelik@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:37:03 +0300 Subject: [PATCH] feat: Enable function for merging disks (#150) --- 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 +}