From b5b66411666b3102c4c7cdf234720217ceb4b487 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:59:23 +0200 Subject: [PATCH 1/6] refactor: make test easier to navigate --- proxmox/config_qemu_test.go | 6918 ++++++++++++++++------------------- 1 file changed, 3143 insertions(+), 3775 deletions(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index f12026c4..75e30219 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -52,3791 +52,3159 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { uint34 := QemuDiskBandwidthIopsLimitConcurrent(34) uint78 := QemuDiskBandwidthIopsLimitBurst(78) uint89 := QemuDiskBandwidthIopsLimitBurst(89) - update_CloudInit := &QemuCloudInitDisk{Format: QemuDiskFormat_Raw, Storage: "test"} - ideBase := &QemuIdeStorage{Disk: &QemuIdeDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} - sataBase := &QemuSataStorage{Disk: &QemuSataDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} - scsiBase := &QemuScsiStorage{Disk: &QemuScsiDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} - virtioBase := &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} - tests := []struct { + update_CloudInit := func() *QemuCloudInitDisk { + return &QemuCloudInitDisk{Format: QemuDiskFormat_Raw, Storage: "test"} + } + ideBase := func() *QemuIdeStorage { + return &QemuIdeStorage{Disk: &QemuIdeDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} + } + sataBase := func() *QemuSataStorage { + return &QemuSataStorage{Disk: &QemuSataDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} + } + scsiBase := func() *QemuScsiStorage { + return &QemuScsiStorage{Disk: &QemuScsiDisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} + } + virtioBase := func() *QemuVirtIOStorage { + return &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: QemuDiskFormat_Raw, Id: 23, SizeInKibibytes: 10, Storage: "test"}} + } + type test struct { name string config *ConfigQemu currentConfig ConfigQemu reboot bool vmr *VmRef output map[string]interface{} + } + create := func(t *testing.T, category string, test test) { + name := category + "/Create/" + test.name + t.Run(name, func(*testing.T) { + reboot, tmpParams, _ := test.config.mapToApiValues(ConfigQemu{}) + require.Equal(t, test.output, tmpParams, name) + require.Equal(t, false, reboot, name) + }) + } + update := func(t *testing.T, category string, test test) { + name := category + "/Update/" + test.name + t.Run(name, func(*testing.T) { + reboot, tmpParams, _ := test.config.mapToApiValues(test.currentConfig) + require.Equal(t, test.output, tmpParams, name) + require.Equal(t, test.reboot, reboot, name) + }) + } + tests := []struct { + category string + create []test + createUpdate []test // value of currentConfig wil be used for update and ignored for create + update []test }{ // TODO add option for create and update, as the crate and update are the same for many settings like 'Agent' - // Create Agent - {name: `Create Agent=nil`, - config: &ConfigQemu{}, - output: map[string]interface{}{}}, - {name: `Create Agent Full`, - config: &ConfigQemu{Agent: &QemuGuestAgent{ - Enable: util.Pointer(true), - Type: util.Pointer(QemuGuestAgentType_VirtIO), - Freeze: util.Pointer(true), - FsTrim: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "1,freeze-fs-on-backup=1,fstrim_cloned_disks=1,type=virtio"}}, - {name: `Create Agent.Enable`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "1"}}, - {name: `Create Agent.Type=""`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Create Agent.Type="virtio"`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, - output: map[string]interface{}{"agent": "0,type=virtio"}}, - {name: `Create Agent.Freeze`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=1"}}, - {name: `Create Agent.FsTrim`, - config: &ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=1"}}, - // Create CloudInit no need for update as update and create behave the same. will be changed in the future - {name: `Create CloudInit=nil`, - config: &ConfigQemu{}, - output: map[string]interface{}{}}, - {name: `Create CloudInit Full`, - config: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{ - Storage: "local-zfs", - FilePath: "ci-meta.yml"}, - Network: &CloudInitSnippet{ - Storage: "local-lvm", - FilePath: "ci-network.yml"}, - User: &CloudInitSnippet{ - Storage: "folder", - FilePath: "ci-user.yml"}, - Vendor: &CloudInitSnippet{ - Storage: "local", - FilePath: "snippets/ci-custom.yml"}}, - DNS: &GuestDNS{ - SearchDomain: util.Pointer("example.com"), - NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, - NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID19: CloudInitNetworkConfig{}, - QemuNetworkInterfaceID31: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}, - PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input()), - UpgradePackages: util.Pointer(true), - UserPassword: util.Pointer("Enter123!"), - Username: util.Pointer("root")}}, - output: map[string]interface{}{ - "cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml", - "searchdomain": "example.com", - "nameserver": "1.1.1.1 8.8.8.8 9.9.9.9", - "ipconfig0": "ip=dhcp,ip6=dhcp", - "ipconfig31": "ip=10.20.4.7/22", - "sshkeys": test_data_qemu.PublicKey_Encoded_Output(), - "ciupgrade": 1, - "cipassword": "Enter123!", - "ciuser": "root"}}, - {name: `Create CloudInit Custom Network`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Network: &CloudInitSnippet{ - Storage: "local", - FilePath: "ci-network.yml"}}}}, - output: map[string]interface{}{"cicustom": "network=local:ci-network.yml"}}, - {name: `Create CloudInit Custom User`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - User: &CloudInitSnippet{ - Storage: "file", - FilePath: "abcd.yml"}}}}, - output: map[string]interface{}{"cicustom": "user=file:abcd.yml"}}, - {name: `Create CloudInit Custom Vendor`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Vendor: &CloudInitSnippet{ - Storage: "local", - FilePath: "vendor-ci"}}}}, - output: map[string]interface{}{"cicustom": "vendor=local:vendor-ci"}}, - {name: `Create CloudInit Custom Meta`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{ - Storage: "local-zfs", - FilePath: "ci-meta.yml"}}}}, - output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml"}}, - {name: `Create CloudInit DNS NameServers`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, - output: map[string]interface{}{"nameserver": "9.9.9.9"}}, - {name: `Create CloudInit DNS NameServers empty`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{}}}}, - output: map[string]interface{}{}}, - {name: `Create CloudInit DNS SearchDomain`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, - output: map[string]interface{}{"searchdomain": "example.com"}}, - {name: `Create CloudInit DNS SearchDomain empty`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, - output: map[string]interface{}{}}, - {name: `Create CloudInit NetworkInterfaces`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID1: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID20: CloudInitNetworkConfig{}, - QemuNetworkInterfaceID30: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}}}, - output: map[string]interface{}{ - "ipconfig1": "ip=dhcp,ip6=dhcp", - "ipconfig30": "ip=10.20.4.7/22"}}, - {name: `Create CloudInit PublicSSHkeys`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, - output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, - {name: `Create CloudInit PublicSSHkeys empty`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, - output: map[string]interface{}{}}, - {name: `Create CloudInit UpgradePackages`, - config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, - output: map[string]interface{}{"ciupgrade": 0}}, - {name: `Create CloudInit UserPassword`, - config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, - output: map[string]interface{}{"cipassword": "Enter123!"}}, - {name: `Create CloudInit Username`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, - output: map[string]interface{}{"ciuser": "root"}}, - {name: `Create CloudInit Username empty`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, - output: map[string]interface{}{}}, - // Create Disks - - // Create Disks.Ide - {name: "Create Disks.Ide.Disk_X.CdRom none", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"ide0": "none,media=cdrom"}, - }, - {name: "Create Disks.Ide.Disk_X.CdRom.Iso", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"ide1": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Create Disks.Ide.Disk_X.CdRom.Passthrough", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"ide2": "cdrom,media=cdrom"}, - }, - {name: "Create Disks.Ide.Disk_X.CloudInit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - output: map[string]interface{}{"ide1": "Test:cloudinit,format=raw"}, - }, - // Create Disks.Ide.Disk_X.Disk - {name: "Create Disks.Ide.Disk_X.Disk All", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - EmulateSSD: true, - Format: format_Raw, - Replicate: true, - Serial: "558485ef-478", - SizeInKibibytes: 33554432, - Storage: "Test", - WorldWideName: "0x5000D31000C9876F", - }}}}}, - output: map[string]interface{}{"ide0": "Test:32,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=558485ef-478,ssd=1,wwn=0x5000D31000C9876F"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk Create Gibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 33554432, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"ide0": "Test:32,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk Create Kibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 33554433, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"ide0": "Test:0.001,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, - output: map[string]interface{}{"ide1": ",aio=native,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Backup: true}}}}}, - output: map[string]interface{}{"ide2": ",replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Cache: QemuDiskCache_DirectSync}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,cache=directsync,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Discard: true}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{EmulateSSD: true}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Format", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Format: format_Raw}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,format=raw,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Replicate: true}}}}}, - output: map[string]interface{}{"ide1": ",backup=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Serial: "558485ef-478"}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,replicate=0,serial=558485ef-478"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Size", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{SizeInKibibytes: 32}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.Storage", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Storage: "Test"}}}}}, - output: map[string]interface{}{"ide0": "Test:0,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Disk.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{WorldWideName: "0x5001234000F876AB"}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0,wwn=0x5001234000F876AB"}, - }, - // Create Disks.Ide.Disk_X.Passthrough - {name: "Create Disks.Ide.Disk_X.Passthrough All", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "test-serial_757465-gdg", - WorldWideName: "0x500CBA2000D76543", - }}}}}, - output: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=test-serial_757465-gdg,ssd=1,wwn=0x500CBA2000D76543"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, - output: map[string]interface{}{"ide1": ",aio=threads,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Backup: true}}}}}, - output: map[string]interface{}{"ide2": ",replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"ide1": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Cache: QemuDiskCache_Unsafe}}}}}, - output: map[string]interface{}{"ide2": ",backup=0,cache=unsafe,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Discard: true}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{EmulateSSD: true}}}}}, - output: map[string]interface{}{"ide0": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.File", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, - output: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.replicate", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Replicate: true}}}}}, - output: map[string]interface{}{"ide2": ",backup=0"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Serial: "test-serial_757465-gdg"}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}, - }, - {name: "Create Disks.Ide.Disk_X.Passthrough.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{WorldWideName: "0x500FED1000B65432"}}}}}, - output: map[string]interface{}{"ide3": ",backup=0,replicate=0,wwn=0x500FED1000B65432"}, - }, - // Create Disks.Sata - {name: "Create Disks.Sata.Disk_X.Disk_X.CdRom none", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"sata0": "none,media=cdrom"}, - }, - {name: "Create Disks.Sata.Disk_X.CdRom.Iso", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"sata1": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Create Disks.Sata.Disk_X.CdRom.Passthrough", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"sata2": "cdrom,media=cdrom"}, - }, - {name: "Create Disks.Sata.Disk_X.CloudInit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - output: map[string]interface{}{"sata1": "Test:cloudinit,format=raw"}, - }, - // Create Disks.Sata.Disk_X.Disk - {name: "Create Disks.Sata.Disk_X.Disk ALL", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Replicate: true, - Serial: "ab_C-12_3", - SizeInKibibytes: 16777216, - Storage: "Test", - WorldWideName: "0x5009876000A321DC", - }}}}}, - output: map[string]interface{}{"sata0": "Test:16,aio=native,cache=unsafe,discard=on,format=qcow2,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=ab_C-12_3,ssd=1,wwn=0x5009876000A321DC"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk Create Gibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 16777216, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"sata0": "Test:16,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk Create Kibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 16777217, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"sata0": "Test:0.001,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, - output: map[string]interface{}{"sata0": ",aio=native,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Backup: true}}}}}, - output: map[string]interface{}{"sata1": ",replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Cache: QemuDiskCache_DirectSync}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,cache=directsync,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Discard: true}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{EmulateSSD: true}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Format", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Format: format_Raw}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,format=raw,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Replicate: true}}}}}, - output: map[string]interface{}{"sata2": ",backup=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Serial: "558485ef-478"}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,replicate=0,serial=558485ef-478"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Size", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{SizeInKibibytes: 32}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.Storage", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Storage: "Test"}}}}}, - output: map[string]interface{}{"sata5": "Test:0,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Disk.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{WorldWideName: "0x500DCBA500E23456"}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,replicate=0,wwn=0x500DCBA500E23456"}, - }, - // Create Disks.Sata.Disk_X.Passthrough - {name: "Create Disks.Sata.Disk_X.Passthrough All", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "test-serial_757465-gdg", - WorldWideName: "0x5007892000C4321A", - }}}}}, - output: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=test-serial_757465-gdg,ssd=1,wwn=0x5007892000C4321A"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, - output: map[string]interface{}{"sata1": ",aio=threads,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Backup: true}}}}}, - output: map[string]interface{}{"sata2": ",replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"sata3": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"sata4": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, - output: map[string]interface{}{"sata0": ",backup=0,cache=unsafe,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Discard: true}}}}}, - output: map[string]interface{}{"sata1": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{EmulateSSD: true}}}}}, - output: map[string]interface{}{"sata2": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.File", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, - output: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Replicate: true}}}}}, - output: map[string]interface{}{"sata4": ",backup=0"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Serial: "test-serial_757465-gdg"}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}, - }, - {name: "Create Disks.Sata.Disk_X.Passthrough.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{WorldWideName: "0x5001ABE000987654"}}}}}, - output: map[string]interface{}{"sata5": ",backup=0,replicate=0,wwn=0x5001ABE000987654"}, - }, - // Create Disks.Scsi - {name: "Create Disks.Scsi.CdRom none", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"scsi0": "none,media=cdrom"}, - }, - {name: "Create Disks.Scsi.CdRom.Iso", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"scsi1": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Create Disks.Scsi.CdRom.Passthrough", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"scsi2": "cdrom,media=cdrom"}, - }, - {name: "Create Disks.Scsi.CloudInit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - output: map[string]interface{}{"scsi1": "Test:cloudinit,format=raw"}, - }, - // Create Disks.Scsi.Disk_X.Disk - {name: "Create Disks.Scsi.Disk_X.Disk All", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - EmulateSSD: true, - Format: format_Raw, - IOThread: true, - ReadOnly: true, - Replicate: true, - Serial: "558485ef-478", - SizeInKibibytes: 76546048, - Storage: "Test", - WorldWideName: "0x500D567800BAC321", - }}}}}, - output: map[string]interface{}{"scsi0": "Test:73,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=558485ef-478,ssd=1,wwn=0x500D567800BAC321"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk Create Gibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ - SizeInKibibytes: 76546048, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"scsi0": "Test:73,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk Create Kibibyte", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ - SizeInKibibytes: 76546049, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"scsi0": "Test:0.001,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, - output: map[string]interface{}{"scsi1": ",aio=native,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{Backup: true}}}}}, - output: map[string]interface{}{"scsi2": ",replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"scsi3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi11": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi12": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"scsi14": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi15": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"scsi17": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"scsi4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"scsi6": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"scsi7": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi8": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"scsi9": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"scsi10": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{Cache: QemuDiskCache_DirectSync}}}}}, - output: map[string]interface{}{"scsi18": ",backup=0,cache=directsync,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{Discard: true}}}}}, - output: map[string]interface{}{"scsi19": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{EmulateSSD: true}}}}}, - output: map[string]interface{}{"scsi20": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Format", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{Format: format_Raw}}}}}, - output: map[string]interface{}{"scsi20": ",backup=0,format=raw,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.IOThread", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{IOThread: true}}}}}, - output: map[string]interface{}{"scsi21": ",backup=0,iothread=1,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.ReadOnly", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_22: &QemuScsiStorage{Disk: &QemuScsiDisk{ReadOnly: true}}}}}, - output: map[string]interface{}{"scsi22": ",backup=0,replicate=0,ro=1"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{Disk: &QemuScsiDisk{Replicate: true}}}}}, - output: map[string]interface{}{"scsi23": ",backup=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_24: &QemuScsiStorage{Disk: &QemuScsiDisk{Serial: "558485ef-478"}}}}}, - output: map[string]interface{}{"scsi24": ",backup=0,replicate=0,serial=558485ef-478"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Size", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Disk: &QemuScsiDisk{SizeInKibibytes: 32}}}}}, - output: map[string]interface{}{"scsi25": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.Storage", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_26: &QemuScsiStorage{Disk: &QemuScsiDisk{Storage: "Test"}}}}}, - output: map[string]interface{}{"scsi26": "Test:0,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Disk.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_27: &QemuScsiStorage{Disk: &QemuScsiDisk{WorldWideName: "0x500EF32100D76589"}}}}}, - output: map[string]interface{}{"scsi27": ",backup=0,replicate=0,wwn=0x500EF32100D76589"}, - }, - // Create Disks.Scsi.Passthrough - {name: "Create Disks.Scsi.Disk_X.Passthrough All", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - ReadOnly: true, - Replicate: true, - Serial: "test-serial_757465-gdg", - WorldWideName: "0x500BCA3000F09876", - }}}}}, - output: map[string]interface{}{"scsi0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=test-serial_757465-gdg,ssd=1,wwn=0x500BCA3000F09876"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, - output: map[string]interface{}{"scsi1": ",aio=threads,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Backup", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Backup: true}}}}}, - output: map[string]interface{}{"scsi2": ",replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"scsi3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"scsi11": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi12": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"scsi14": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi15": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"scsi17": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"scsi4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"scsi6": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"scsi7": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"scsi8": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"scsi9": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"scsi10": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Cache", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, - output: map[string]interface{}{"scsi18": ",backup=0,cache=unsafe,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Discard", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Discard: true}}}}}, - output: map[string]interface{}{"scsi19": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.EmulateSSD", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{EmulateSSD: true}}}}}, - output: map[string]interface{}{"scsi20": ",backup=0,replicate=0,ssd=1"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.File", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, - output: map[string]interface{}{"scsi21": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.IOThread", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_22: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{IOThread: true}}}}}, - output: map[string]interface{}{"scsi22": ",backup=0,iothread=1,replicate=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.ReadOnly", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ReadOnly: true}}}}}, - output: map[string]interface{}{"scsi23": ",backup=0,replicate=0,ro=1"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_24: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Replicate: true}}}}}, - output: map[string]interface{}{"scsi24": ",backup=0"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.Serial", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Serial: "test-serial_757465-gdg"}}}}}, - output: map[string]interface{}{"scsi25": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}, - }, - {name: "Create Disks.Scsi.Disk_X.Passthrough.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{WorldWideName: "0x5004DC0100E239C7"}}}}}, - output: map[string]interface{}{"scsi25": ",backup=0,replicate=0,wwn=0x5004DC0100E239C7"}, - }, - // Create Disks.VirtIO - {name: "Create Disks.VirtIO.Disk_X.CdRom none", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"virtio0": "none,media=cdrom"}, - }, - {name: "Create Disks.VirtIO.Disk_X.CdRom.Iso", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"virtio1": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Create Disks.VirtIO.Disk_X.CdRom.Passthrough", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"virtio2": "cdrom,media=cdrom"}, - }, - {name: "Create Disks.VirtIO.Disk_X.CloudInit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - output: map[string]interface{}{"virtio1": "Test:cloudinit,format=raw"}, - }, - // Create Disks.VirtIO.Disk - {name: "Create Disks.VirtIO.Disk_X.Disk All", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - Format: format_Raw, - IOThread: true, - ReadOnly: true, - Replicate: true, - Serial: "558485ef-478", - SizeInKibibytes: 8238661632, - Storage: "Test", - WorldWideName: "0x500A7B0800F345D2", - }}}}}, - output: map[string]interface{}{"virtio0": "Test:7857,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=558485ef-478,wwn=0x500A7B0800F345D2"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk Create Gibibyte", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 8238661632, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"virtio0": "Test:7857,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk Create Kibibyte", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 8238661633, - Storage: "Test", - }}}}}, - output: map[string]interface{}{"virtio0": "Test:0.001,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, - output: map[string]interface{}{"virtio1": ",aio=native,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Backup", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Backup: true}}}}}, - output: map[string]interface{}{"virtio2": ",replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"virtio3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"virtio11": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio12": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"virtio14": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio15": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"virtio1": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"virtio4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 1}}}}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0,iops_rd_max_length=1,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"virtio7": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"virtio9": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}}}}}}, - output: map[string]interface{}{"virtio9": ",backup=0,iops_wr_max_length=2,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"virtio10": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Cache", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Cache: QemuDiskCache_DirectSync}}}}}, - output: map[string]interface{}{"virtio2": ",backup=0,cache=directsync,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Discard", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Discard: true}}}}}, - output: map[string]interface{}{"virtio3": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Format", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: format_Raw}}}}}, - output: map[string]interface{}{"virtio4": ",backup=0,format=raw,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.IOThread", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{IOThread: true}}}}}, - output: map[string]interface{}{"virtio4": ",backup=0,iothread=1,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.ReadOnly", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ReadOnly: true}}}}}, - output: map[string]interface{}{"virtio5": ",backup=0,replicate=0,ro=1"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Replicate: true}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Serial", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Serial: "558485ef-478"}}}}}, - output: map[string]interface{}{"virtio7": ",backup=0,replicate=0,serial=558485ef-478"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Size", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{SizeInKibibytes: 32}}}}}, - output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.Storage", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Storage: "Test"}}}}}, - output: map[string]interface{}{"virtio9": "Test:0,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Disk.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{WorldWideName: "0x5005FED000B87632"}}}}}, - output: map[string]interface{}{"virtio10": ",backup=0,replicate=0,wwn=0x5005FED000B87632"}, - }, - // Create Disks.VirtIO.Disk_X.Passthrough - {name: "Create Disks.VirtIO.Disk_X.Passthrough All", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - ReadOnly: true, - Replicate: true, - Serial: "test-serial_757465-gdg", - WorldWideName: "0x500C329500A1EFAB", - }}}}}, - output: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=test-serial_757465-gdg,wwn=0x500C329500A1EFAB"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.AsyncIO", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, - output: map[string]interface{}{"virtio1": ",aio=threads,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Backup", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Backup: true}}}}}, - output: map[string]interface{}{"virtio2": ",replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, - output: map[string]interface{}{"virtio3": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, - output: map[string]interface{}{"virtio11": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio12": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, - output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max=78,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, - output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max_length=3,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, - output: map[string]interface{}{"virtio14": ",backup=0,iops_rd=34,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio15": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, - output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max=89,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, - output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max_length=4,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, - output: map[string]interface{}{"virtio1": ",backup=0,iops_wr=23,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, - output: map[string]interface{}{"virtio4": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio5": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0,mbps_rd_max=99.2,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, - output: map[string]interface{}{"virtio7": ",backup=0,mbps_rd=10.3,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, - output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, - output: map[string]interface{}{"virtio9": ",backup=0,mbps_wr_max=79.23,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, - output: map[string]interface{}{"virtio10": ",backup=0,mbps_wr=45.23,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Cache", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, - output: map[string]interface{}{"virtio2": ",backup=0,cache=unsafe,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Discard", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Discard: true}}}}}, - output: map[string]interface{}{"virtio3": ",backup=0,discard=on,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.File", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, - output: map[string]interface{}{"virtio4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.IOThread", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{IOThread: true}}}}}, - output: map[string]interface{}{"virtio5": ",backup=0,iothread=1,replicate=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.ReadOnly", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ReadOnly: true}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0,replicate=0,ro=1"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Replicate", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Replicate: true}}}}}, - output: map[string]interface{}{"virtio6": ",backup=0"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.Serial", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Serial: "test-serial_757465-gdg"}}}}}, - output: map[string]interface{}{"virtio7": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}, - }, - {name: "Create Disks.VirtIO.Disk_X.Passthrough.WorldWideName", - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{WorldWideName: "0x500D41A600C67853"}}}}}, - output: map[string]interface{}{"virtio8": ",backup=0,replicate=0,wwn=0x500D41A600C67853"}, - }, - // Create Iso - {name: "Create Iso", - config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - output: map[string]interface{}{"ide2": "test:iso/file.iso,media=cdrom"}, - }, - // Create Tags - {name: `Create Tags Empty`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, - output: map[string]interface{}{"tags": string("")}, - }, - {name: `Create Tags Full`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, - output: map[string]interface{}{"tags": string("tag1;tag2")}, - }, - // Create TPM - {name: "Create TPM", - config: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0)}}, - output: map[string]interface{}{"tpmstate0": "test:1,version=v2.0"}, - }, - // Delete - - // Delete TPM - {name: "Delete TPM", - config: &ConfigQemu{TPM: &TpmState{Delete: true}}, - output: map[string]interface{}{"delete": "tpmstate0"}}, - {name: "Delete TPM Full", - config: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0), Delete: true}}, - output: map[string]interface{}{"delete": "tpmstate0"}}, - // Update - - // Update agent - {name: `Update Agent !nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent nil !nil`, - config: &ConfigQemu{}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{ - Enable: util.Pointer(true), - Type: util.Pointer(QemuGuestAgentType_VirtIO), - Freeze: util.Pointer(true), - FsTrim: util.Pointer(true)}}, - output: map[string]interface{}{}}, - {name: `Update Agent nil nil `, - config: &ConfigQemu{}, - output: map[string]interface{}{}}, - {name: `Update Agent.Enable !nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "1"}}, - {name: `Update Agent.Enable nil !nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "1"}}, - {name: `Update Agent.Enable nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent.Type !nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0,type=virtio"}}, - {name: `Update Agent.Type "" !nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent.Type "" nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent.Type nil !nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, - output: map[string]interface{}{"agent": "0,type=virtio"}}, - {name: `Update Agent.Type nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent.Freeze !nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(false)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=0"}}, - {name: `Update Agent.Freeze nil !nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=1"}}, - {name: `Update Agent.Freeze nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - {name: `Update Agent.FsTrim !nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(false)}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=0"}}, - {name: `Update Agent.FsTrim nil !nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(true)}}, - output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=1"}}, - {name: `Update Agent.FsTrim nil nil`, - config: &ConfigQemu{Agent: &QemuGuestAgent{}}, - currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, - output: map[string]interface{}{"agent": "0"}}, - // Update CloudInit - {name: `Update CloudInit=nil`, - config: &ConfigQemu{}, - output: map[string]interface{}{}}, - {name: `Update CloudInit Custom clear`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{}, - Network: &CloudInitSnippet{}, - User: &CloudInitSnippet{}, - Vendor: &CloudInitSnippet{}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, - output: map[string]interface{}{"cicustom": ""}}, - {name: `Update CloudInit Custom Network`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Network: &CloudInitSnippet{ - Storage: "newStorage", - FilePath: "new.yml"}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, - output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=newStorage:new.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"}}, - {name: `Update CloudInit Custom User`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - User: &CloudInitSnippet{ - Storage: "newStorage", - FilePath: "new.yml"}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, - output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=newStorage:new.yml,vendor=local:snippets/ci-custom.yml"}}, - {name: `Update CloudInit Custom Vendor`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Vendor: &CloudInitSnippet{ - Storage: "newStorage", - FilePath: "new.yml"}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, - output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=newStorage:new.yml"}}, - {name: `Update CloudInit Custom Meta`, - config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{ - Storage: "newStorage", - FilePath: "new.yml"}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, - output: map[string]interface{}{"cicustom": "meta=newStorage:new.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"}}, - {name: `Update CloudInit DNS NameServers`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, - output: map[string]interface{}{"nameserver": "9.9.9.9"}}, - {name: `Update CloudInit DNS NameServers empty`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, - output: map[string]interface{}{"delete": "nameserver"}}, - {name: `Update CloudInit DNS SearchDomain`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, - output: map[string]interface{}{"searchdomain": "example.com"}}, - {name: `Update CloudInit DNS SearchDomain empty`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, - output: map[string]interface{}{"delete": "searchdomain"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.Address update`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.1.10/24"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig0": "ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.Address remove`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID1: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID1: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig1": "gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.DHCP set`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID2: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID2: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig2": "ip=dhcp,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.Gateway update`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID3: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID3: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig3": "ip=192.168.56.30/24,gw=192.168.1.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.Gateway overwrite Ipv4.DHCP`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID4: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID4: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}}}}}, - output: map[string]interface{}{"ipconfig4": "gw=192.168.1.1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv4.Gateway remove`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID5: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID5: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig5": "ip=192.168.56.30/24,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Address update`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID6: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/48"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID6: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig6": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:85a3::/48,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Address remove`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID7: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID7: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig7": "ip=192.168.56.30/24,gw=192.168.56.1,gw6=2001:0db8:abcd::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.DHCP set`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID8: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID8: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig8": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=dhcp"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Gateway update`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID9: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID9: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig9": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:85a3::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Gateway overwrite Ipv6.DHCP`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID10: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID10: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, - output: map[string]interface{}{"ipconfig10": "gw6=2001:0db8:85a3::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Gateway overwrite Ipv6.SLAAC`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID11: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID11: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{SLAAC: true}}}}}, - output: map[string]interface{}{"ipconfig11": "gw6=2001:0db8:85a3::1"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.Gateway remove`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID12: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID12: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig12": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48"}}, - {name: `Update CloudInit NetworkInterfaces Ipv6.SLAAC set`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID13: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{SLAAC: true}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID13: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"ipconfig13": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=auto"}}, - {name: `Update CloudInit NetworkInterfaces delete existing interface`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID14: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("")), - Gateway: util.Pointer(IPv4Address(""))}, - IPv6: &CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - Gateway: util.Pointer(IPv6Address(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID14: cloudInitNetworkConfig()}}}, - output: map[string]interface{}{"delete": "ipconfig14"}}, - {name: `Update CloudInit NetworkInterfaces delete non-existing interface`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID20: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("")), - Gateway: util.Pointer(IPv4Address(""))}, - IPv6: &CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - Gateway: util.Pointer(IPv6Address(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{}}}, - output: map[string]interface{}{}}, - {name: `Update CloudInit NetworkInterfaces no updates`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID29: cloudInitNetworkConfig(), - QemuNetworkInterfaceID30: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, - output: map[string]interface{}{}}, - {name: `Update CloudInit NetworkInterfaces full`, - config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.1.10/24"))}}, - QemuNetworkInterfaceID1: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))}}, - QemuNetworkInterfaceID2: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}}, - QemuNetworkInterfaceID3: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}, - QemuNetworkInterfaceID4: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}, - QemuNetworkInterfaceID5: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))}}, - QemuNetworkInterfaceID6: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/48"))}}, - QemuNetworkInterfaceID7: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))}}, - QemuNetworkInterfaceID8: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID9: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, - QemuNetworkInterfaceID10: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, - QemuNetworkInterfaceID11: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, - QemuNetworkInterfaceID12: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))}}, - QemuNetworkInterfaceID13: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{SLAAC: true}}, - QemuNetworkInterfaceID14: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("")), - Gateway: util.Pointer(IPv4Address(""))}, - IPv6: &CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - Gateway: util.Pointer(IPv6Address(""))}}, - QemuNetworkInterfaceID20: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("")), - Gateway: util.Pointer(IPv4Address(""))}, - IPv6: &CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - Gateway: util.Pointer(IPv6Address(""))}}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: cloudInitNetworkConfig(), - QemuNetworkInterfaceID1: cloudInitNetworkConfig(), - QemuNetworkInterfaceID2: cloudInitNetworkConfig(), - QemuNetworkInterfaceID3: cloudInitNetworkConfig(), - QemuNetworkInterfaceID4: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}}, - QemuNetworkInterfaceID5: cloudInitNetworkConfig(), - QemuNetworkInterfaceID6: cloudInitNetworkConfig(), - QemuNetworkInterfaceID7: cloudInitNetworkConfig(), - QemuNetworkInterfaceID8: cloudInitNetworkConfig(), - QemuNetworkInterfaceID9: cloudInitNetworkConfig(), - QemuNetworkInterfaceID10: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID11: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{SLAAC: true}}, - QemuNetworkInterfaceID12: cloudInitNetworkConfig(), - QemuNetworkInterfaceID13: cloudInitNetworkConfig(), - QemuNetworkInterfaceID14: cloudInitNetworkConfig(), - QemuNetworkInterfaceID29: cloudInitNetworkConfig(), - QemuNetworkInterfaceID30: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, - output: map[string]interface{}{ - "ipconfig0": "ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", - "ipconfig1": "gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", - "ipconfig2": "ip=dhcp,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", - "ipconfig3": "ip=192.168.56.30/24,gw=192.168.1.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", - "ipconfig4": "gw=192.168.1.1", - "ipconfig5": "ip=192.168.56.30/24,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", - "ipconfig6": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:85a3::/48,gw6=2001:0db8:abcd::1", - "ipconfig7": "ip=192.168.56.30/24,gw=192.168.56.1,gw6=2001:0db8:abcd::1", - "ipconfig8": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=dhcp", - "ipconfig9": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:85a3::1", - "ipconfig10": "gw6=2001:0db8:85a3::1", - "ipconfig11": "gw6=2001:0db8:85a3::1", - "ipconfig12": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48", - "ipconfig13": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=auto", - "delete": "ipconfig14"}}, - {name: `Update CloudInit PublicSSHkeys`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, - output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, - {name: `Update CloudInit PublicSSHkeys empty`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, - output: map[string]interface{}{"delete": "sshkeys"}}, - {name: `Update CloudInit UpgradePackages`, - config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(true)}}, - output: map[string]interface{}{"ciupgrade": 0}}, - {name: `Update CloudInit UserPassword`, - config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Abc123!")}}, - output: map[string]interface{}{"cipassword": "Enter123!"}}, - {name: `Update CloudInit Username`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, - output: map[string]interface{}{"ciuser": "root"}}, - {name: `Update CloudInit Username empty`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, - output: map[string]interface{}{"delete": "ciuser"}}, - // Update Disk - // Update Disk.Ide - {name: "Update Disk.Ide.Disk_X DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, - output: map[string]interface{}{"delete": "ide0"}, - }, - // Update Disk.Ide.Disk_X.CdRom - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE ISO TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"ide1": "none,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE ISO TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"ide2": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE None TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"ide3": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE None TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"ide0": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE Passthrough TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"ide1": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom CHANGE Passthrough TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"ide2": "none,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{}}}}, - output: map[string]interface{}{"delete": "ide3"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom.Iso.File CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"ide1": "Test:iso/test2.iso,media=cdrom"}, - }, - {name: "Update Disk.Ide.Disk_X.CdRom.Iso.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, - output: map[string]interface{}{"ide2": "NewStorage:iso/test.iso,media=cdrom"}, - }, - // Update Disk.Ide.Disk_X.CloudInit - {name: "Update Disk.Ide.Disk_X.CloudInit DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{}}}}, - output: map[string]interface{}{"delete": "ide3"}, - }, - {name: "Update Disk.Ide.Disk_X.CloudInit SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: update_CloudInit}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.CloudInit.Format CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, - output: map[string]interface{}{"ide1": "Test:cloudinit,format=qcow2"}, - }, - {name: "Update Disk.Ide.Disk_X.CloudInit.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, - output: map[string]interface{}{"ide2": "NewStorage:cloudinit,format=raw"}, - }, - // Update Disk.Ide.Disk_X.Disk - {name: "Update Disk.Ide.Disk_X.Disk CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide3": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide3": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide3": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - syntax: diskSyntaxVolume, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide3": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: ideBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, - output: map[string]interface{}{"delete": "ide0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk MIGRATE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"ide1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk MIGRATE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"ide1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk MIGRATE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"ide1": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk MIGRATE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"ide1": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Gibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Gibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Kibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Kibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE UP File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE UP File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE UP Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk RESIZE UP Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: ideBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk.Format CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide1": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk.Format CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"ide1": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Disk.Format CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Ide.Disk_X.Disk.Format CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.Ide.Disk_X.Passthrough - {name: "Update Disk.Ide.Disk_X.Passthrough CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{"ide0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Ide.Disk_X.Passthrough SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.Sata - {name: "Update Disk.Sata.Disk_X DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}}}, - output: map[string]interface{}{"delete": "sata0"}, - }, - // Update Disk.Sata.Disk_X.CdRom - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE ISO TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"sata1": "none,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE ISO TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"sata2": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE None TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"sata3": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE None TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"sata4": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE Passthrough TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"sata5": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom CHANGE Passthrough TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"sata0": "none,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{}}}}, - output: map[string]interface{}{"delete": "sata1"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom.Iso.File CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"sata3": "Test:iso/test2.iso,media=cdrom"}, - }, - {name: "Update Disk.Sata.Disk_X.CdRom.Iso.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, - output: map[string]interface{}{"sata4": "NewStorage:iso/test.iso,media=cdrom"}, - }, - // Update Disk.Sata.Disk_X.CloudInit - {name: "Update Disk.Sata.Disk_X.CloudInit DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{}}}}, - output: map[string]interface{}{"delete": "sata5"}, - }, - {name: "Update Disk.Sata.Disk_X.CloudInit SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: update_CloudInit}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.CloudInit.Format CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, - output: map[string]interface{}{"sata1": "Test:cloudinit,format=qcow2"}, - }, - {name: "Update Disk.Sata.Disk_X.CloudInit.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, - output: map[string]interface{}{"sata2": "NewStorage:cloudinit,format=raw"}, - }, - // Update Disk.Sata.Disk_X.Disk - {name: "Update Disk.Sata.Disk_X.Disk CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: sataBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{}}}}, - output: map[string]interface{}{"delete": "sata4"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk MIGRATE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"sata5": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk MIGRATE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"sata5": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk MIGRATE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"sata5": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk MIGRATE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"sata5": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Gibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Gibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:9,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:9,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Kibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Kibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:0.001,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata0": "test:0.001,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE UP File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE UP File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE UP Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk RESIZE UP Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: sataBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk.Format CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk.Format CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Disk.Format CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Sata.Disk_X.Disk.Format CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.Sata.Disk_X.Passthrough - {name: "Update Disk.Sata.Disk_X.Passthrough CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{"sata0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Sata.Disk_X.Passthrough SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.Scsi - {name: "Update Disk.Scsi.Disk_X DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}}}, - output: map[string]interface{}{"delete": "scsi0"}, - }, - // Update Disk.Scsi.Disk_X.CdRom - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE ISO TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"scsi1": "none,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE ISO TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"scsi2": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE None TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"scsi3": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE None TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"scsi4": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE Passthrough TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"scsi5": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom CHANGE Passthrough TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"scsi6": "none,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{}}}}, - output: map[string]interface{}{"delete": "scsi7"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom.Iso.File CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"scsi9": "Test:iso/test2.iso,media=cdrom"}, - }, - {name: "Update Disk.Scsi.Disk_X.CdRom.Iso.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, - output: map[string]interface{}{"scsi10": "NewStorage:iso/test.iso,media=cdrom"}, - }, - // Update Disk.Scsi.Disk_X.CloudInit - {name: "Update Disk.Scsi.Disk_X.CloudInit DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{}}}}, - output: map[string]interface{}{"delete": "scsi11"}, - }, - {name: "Update Disk.Scsi.Disk_X.CloudInit SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{CloudInit: update_CloudInit}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.CloudInit.Format CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, - output: map[string]interface{}{"scsi13": "Test:cloudinit,format=qcow2"}, - }, - {name: "Update Disk.Scsi.Disk_X.CloudInit.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, - output: map[string]interface{}{"scsi14": "NewStorage:cloudinit,format=raw"}, - }, - // Update Disk.Scsi.Disk_X.Disk - {name: "Update Disk.Scsi.Disk_X.Disk CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi15": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi15": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi15": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi15": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: scsiBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{}}}}, - output: map[string]interface{}{"delete": "scsi16"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk MIGRATE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"scsi17": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk MIGRATE File Linked Clone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"scsi17": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk MIGRATE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"scsi17": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk MIGRATE Volume Linked Clone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"scsi17": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE UP File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE UP File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE UP Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk RESIZE UP Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: scsiBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk.Format CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi21": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk.Format CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"scsi21": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk.Format CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.Scsi.Disk_X.Disk.Format CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.Scsi.Disk_X.Passthrough - {name: "Update Disk.Scsi.Disk_X.Passthrough CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{"scsi0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.Scsi.Disk_X.Passthrough SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.VirtIO - {name: "Update Disk.VirtIO.Disk_X DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, - output: map[string]interface{}{"delete": "virtio0"}, - }, - // Update Disk.VirtIO.Disk_X.CdRom - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE ISO TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"virtio1": "none,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE ISO TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"virtio2": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE None TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"virtio3": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE None TO Passthrough", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{"virtio4": "cdrom,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE Passthrough TO ISO", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"virtio5": "Test:iso/test.iso,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom CHANGE Passthrough TO None", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - output: map[string]interface{}{"virtio6": "none,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{}}}}, - output: map[string]interface{}{"delete": "virtio7"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom.Iso.File CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, - output: map[string]interface{}{"virtio9": "Test:iso/test2.iso,media=cdrom"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CdRom.Iso.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, - output: map[string]interface{}{"virtio10": "NewStorage:iso/test.iso,media=cdrom"}, - }, - // Update Disk.VirtIO.Disk_X.CloudInit - {name: "Update Disk.VirtIO.Disk_X.CloudInit DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{}}}}, - output: map[string]interface{}{"delete": "virtio11"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CloudInit SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{CloudInit: update_CloudInit}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{CloudInit: update_CloudInit}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.CloudInit.Format CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, - output: map[string]interface{}{"virtio13": "Test:cloudinit,format=qcow2"}, - }, - {name: "Update Disk.VirtIO.Disk_X.CloudInit.Storage CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, - output: map[string]interface{}{"virtio14": "NewStorage:cloudinit,format=raw"}, - }, - // Update Disk.VirtIO.Disk_X.Disk - {name: "Update Disk.VirtIO.Disk_X.Disk CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio15": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio15": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio15": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_Native, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio15": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk DELETE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: virtioBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, - output: map[string]interface{}{"delete": "virtio0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk MIGRATE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"virtio1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk MIGRATE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"virtio1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk MIGRATE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"virtio1": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk MIGRATE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test1", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 10, - Storage: "test2", - }}}}}, - output: map[string]interface{}{"virtio1": "test2:vm-0-disk-23,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437185, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437184, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 9437186, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 9437185, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE UP File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE UP File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE UP Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk RESIZE UP Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - SizeInKibibytes: 11, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: virtioBase}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk.Format CHANGE File", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio5": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk.Format CHANGE File LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{"virtio5": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk.Format CHANGE Volume", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - {name: "Update Disk.VirtIO.Disk_X.Disk.Format CHANGE Volume LinkedClone", - currentConfig: ConfigQemu{ - LinkedVmId: 100, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Id: 23, - LinkedDiskId: &uint1, - SizeInKibibytes: 10, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 10, - Storage: "test", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Disk.VirtIO.Disk_X.Passthrough - {name: "Update Disk.VirtIO.Disk_X.Passthrough CHANGE", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{"virtio0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}, - }, - {name: "Update Disk.VirtIO.Disk_X.Passthrough SAME", - currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - File: "/dev/disk/sda", - }}}}}, - config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - File: "/dev/disk/sda", - }}}}}, - output: map[string]interface{}{}, - }, - // Update Iso - {name: "Update Iso nil", - currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - config: &ConfigQemu{Iso: nil}, - output: map[string]interface{}{}, - }, - {name: "Update Iso SAME", - currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - output: map[string]interface{}{"ide2": "test:iso/file.iso,media=cdrom"}, - }, - {name: "Update Iso.File", - currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file2.iso"}}, - output: map[string]interface{}{"ide2": "test:iso/file2.iso,media=cdrom"}, - }, - {name: "Update Iso.Storage", - currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, - config: &ConfigQemu{Iso: &IsoFile{Storage: "NewStorage", File: "file.iso"}}, - output: map[string]interface{}{"ide2": "NewStorage:iso/file.iso,media=cdrom"}, - }, - // Update Tags - {name: `Update Tags Empty`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, - output: map[string]interface{}{"tags": string("")}, - }, - {name: `Update Tags Full`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, - output: map[string]interface{}{"tags": string("tag1;tag2")}, - }, - // Update TPM - {name: "Update TPM", - config: &ConfigQemu{TPM: &TpmState{Storage: "aaaa", Version: util.Pointer(TpmVersion_1_2)}}, - currentConfig: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0)}}, - output: map[string]interface{}{}}, + {category: `Agent`, + create: []test{ + {name: `Agent=nil`, + config: &ConfigQemu{}, + output: map[string]interface{}{}}, + {name: `Agent Full`, + config: &ConfigQemu{Agent: &QemuGuestAgent{ + Enable: util.Pointer(true), + Type: util.Pointer(QemuGuestAgentType_VirtIO), + Freeze: util.Pointer(true), + FsTrim: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "1,freeze-fs-on-backup=1,fstrim_cloned_disks=1,type=virtio"}}, + {name: `Agent.Enable`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "1"}}, + {name: `Agent.Type=""`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.Type="virtio"`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, + output: map[string]interface{}{"agent": "0,type=virtio"}}, + {name: `Agent.Freeze`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=1"}}, + {name: `Agent.FsTrim`, + config: &ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=1"}}}, + update: []test{ + {name: `Agent !nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent nil !nil`, + config: &ConfigQemu{}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{ + Enable: util.Pointer(true), + Type: util.Pointer(QemuGuestAgentType_VirtIO), + Freeze: util.Pointer(true), + FsTrim: util.Pointer(true)}}, + output: map[string]interface{}{}}, + {name: `Agent nil nil `, + config: &ConfigQemu{}, + output: map[string]interface{}{}}, + {name: `Agent.Enable !nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "1"}}, + {name: `Agent.Enable nil !nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "1"}}, + {name: `Agent.Enable nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.Type !nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0,type=virtio"}}, + {name: `Agent.Type "" !nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.Type "" nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_None)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.Type nil !nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType_VirtIO)}}, + output: map[string]interface{}{"agent": "0,type=virtio"}}, + {name: `Agent.Type nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.Freeze !nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(false)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=0"}}, + {name: `Agent.Freeze nil !nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{Freeze: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "0,freeze-fs-on-backup=1"}}, + {name: `Agent.Freeze nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}, + {name: `Agent.FsTrim !nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(false)}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=0"}}, + {name: `Agent.FsTrim nil !nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{FsTrim: util.Pointer(true)}}, + output: map[string]interface{}{"agent": "0,fstrim_cloned_disks=1"}}, + {name: `Agent.FsTrim nil nil`, + config: &ConfigQemu{Agent: &QemuGuestAgent{}}, + currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, + output: map[string]interface{}{"agent": "0"}}}}, + {category: `CloudInit`, // Create CloudInit no need for update as update and create behave the same. will be changed in the future + create: []test{ + {name: `CloudInit=nil`, + config: &ConfigQemu{}, + output: map[string]interface{}{}}, + {name: `CloudInit Full`, + config: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{ + Storage: "local-zfs", + FilePath: "ci-meta.yml"}, + Network: &CloudInitSnippet{ + Storage: "local-lvm", + FilePath: "ci-network.yml"}, + User: &CloudInitSnippet{ + Storage: "folder", + FilePath: "ci-user.yml"}, + Vendor: &CloudInitSnippet{ + Storage: "local", + FilePath: "snippets/ci-custom.yml"}}, + DNS: &GuestDNS{ + SearchDomain: util.Pointer("example.com"), + NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, + NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID19: CloudInitNetworkConfig{}, + QemuNetworkInterfaceID31: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}, + PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input()), + UpgradePackages: util.Pointer(true), + UserPassword: util.Pointer("Enter123!"), + Username: util.Pointer("root")}}, + output: map[string]interface{}{ + "cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml", + "searchdomain": "example.com", + "nameserver": "1.1.1.1 8.8.8.8 9.9.9.9", + "ipconfig0": "ip=dhcp,ip6=dhcp", + "ipconfig31": "ip=10.20.4.7/22", + "sshkeys": test_data_qemu.PublicKey_Encoded_Output(), + "ciupgrade": 1, + "cipassword": "Enter123!", + "ciuser": "root"}}, + {name: `CloudInit Custom Network`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Network: &CloudInitSnippet{ + Storage: "local", + FilePath: "ci-network.yml"}}}}, + output: map[string]interface{}{"cicustom": "network=local:ci-network.yml"}}, + {name: `CloudInit Custom User`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + User: &CloudInitSnippet{ + Storage: "file", + FilePath: "abcd.yml"}}}}, + output: map[string]interface{}{"cicustom": "user=file:abcd.yml"}}, + {name: `CloudInit Custom Vendor`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Vendor: &CloudInitSnippet{ + Storage: "local", + FilePath: "vendor-ci"}}}}, + output: map[string]interface{}{"cicustom": "vendor=local:vendor-ci"}}, + {name: `CloudInit Custom Meta`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{ + Storage: "local-zfs", + FilePath: "ci-meta.yml"}}}}, + output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml"}}, + {name: `CloudInit DNS NameServers`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, + output: map[string]interface{}{"nameserver": "9.9.9.9"}}, + {name: `CloudInit DNS NameServers empty`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{}}}}, + output: map[string]interface{}{}}, + {name: `CloudInit DNS SearchDomain`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, + output: map[string]interface{}{"searchdomain": "example.com"}}, + {name: `CloudInit DNS SearchDomain empty`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, + output: map[string]interface{}{}}, + {name: `CloudInit NetworkInterfaces`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID1: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID20: CloudInitNetworkConfig{}, + QemuNetworkInterfaceID30: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}}}, + output: map[string]interface{}{ + "ipconfig1": "ip=dhcp,ip6=dhcp", + "ipconfig30": "ip=10.20.4.7/22"}}, + {name: `CloudInit PublicSSHkeys`, + config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, + output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, + {name: `CloudInit PublicSSHkeys empty`, + config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, + output: map[string]interface{}{}}, + {name: `CloudInit UpgradePackages`, + config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, + output: map[string]interface{}{"ciupgrade": 0}}, + {name: `CloudInit UserPassword`, + config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, + output: map[string]interface{}{"cipassword": "Enter123!"}}, + {name: `CloudInit Username`, + config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, + output: map[string]interface{}{"ciuser": "root"}}, + {name: `CloudInit Username empty`, + config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, + output: map[string]interface{}{}}}, + update: []test{ + {name: `CloudInit=nil`, + config: &ConfigQemu{}, + output: map[string]interface{}{}}, + {name: `CloudInit Custom clear`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{}, + Network: &CloudInitSnippet{}, + User: &CloudInitSnippet{}, + Vendor: &CloudInitSnippet{}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, + output: map[string]interface{}{"cicustom": ""}}, + {name: `CloudInit Custom Network`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Network: &CloudInitSnippet{ + Storage: "newStorage", + FilePath: "new.yml"}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, + output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=newStorage:new.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"}}, + {name: `CloudInit Custom User`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + User: &CloudInitSnippet{ + Storage: "newStorage", + FilePath: "new.yml"}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, + output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=newStorage:new.yml,vendor=local:snippets/ci-custom.yml"}}, + {name: `CloudInit Custom Vendor`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Vendor: &CloudInitSnippet{ + Storage: "newStorage", + FilePath: "new.yml"}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, + output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=newStorage:new.yml"}}, + {name: `CloudInit Custom Meta`, + config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{ + Storage: "newStorage", + FilePath: "new.yml"}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, + output: map[string]interface{}{"cicustom": "meta=newStorage:new.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"}}, + {name: `CloudInit DNS NameServers`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, + output: map[string]interface{}{"nameserver": "9.9.9.9"}}, + {name: `CloudInit DNS NameServers empty`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, + output: map[string]interface{}{"delete": "nameserver"}}, + {name: `CloudInit DNS SearchDomain`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, + output: map[string]interface{}{"searchdomain": "example.com"}}, + {name: `CloudInit DNS SearchDomain empty`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, + output: map[string]interface{}{"delete": "searchdomain"}}, + {name: `CloudInit NetworkInterfaces Ipv4.Address update`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.1.10/24"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig0": "ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv4.Address remove`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID1: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID1: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig1": "gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv4.DHCP set`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID2: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID2: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig2": "ip=dhcp,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv4.Gateway update`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID3: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID3: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig3": "ip=192.168.56.30/24,gw=192.168.1.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv4.Gateway overwrite Ipv4.DHCP`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID4: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID4: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}}}}}, + output: map[string]interface{}{"ipconfig4": "gw=192.168.1.1"}}, + {name: `CloudInit NetworkInterfaces Ipv4.Gateway remove`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID5: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID5: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig5": "ip=192.168.56.30/24,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Address update`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID6: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/48"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID6: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig6": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:85a3::/48,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Address remove`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID7: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID7: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig7": "ip=192.168.56.30/24,gw=192.168.56.1,gw6=2001:0db8:abcd::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.DHCP set`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID8: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID8: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig8": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=dhcp"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Gateway update`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID9: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID9: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig9": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:85a3::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Gateway overwrite Ipv6.DHCP`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID10: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID10: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, + output: map[string]interface{}{"ipconfig10": "gw6=2001:0db8:85a3::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Gateway overwrite Ipv6.SLAAC`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{SLAAC: true}}}}}, + output: map[string]interface{}{"ipconfig11": "gw6=2001:0db8:85a3::1"}}, + {name: `CloudInit NetworkInterfaces Ipv6.Gateway remove`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID12: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID12: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig12": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48"}}, + {name: `CloudInit NetworkInterfaces Ipv6.SLAAC set`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID13: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{SLAAC: true}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID13: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"ipconfig13": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=auto"}}, + {name: `CloudInit NetworkInterfaces delete existing interface`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID14: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("")), + Gateway: util.Pointer(IPv4Address(""))}, + IPv6: &CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + Gateway: util.Pointer(IPv6Address(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID14: cloudInitNetworkConfig()}}}, + output: map[string]interface{}{"delete": "ipconfig14"}}, + {name: `CloudInit NetworkInterfaces delete non-existing interface`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID20: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("")), + Gateway: util.Pointer(IPv4Address(""))}, + IPv6: &CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + Gateway: util.Pointer(IPv6Address(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{}}}, + output: map[string]interface{}{}}, + {name: `CloudInit NetworkInterfaces no updates`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID29: cloudInitNetworkConfig(), + QemuNetworkInterfaceID30: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, + output: map[string]interface{}{}}, + {name: `CloudInit NetworkInterfaces full`, + config: &ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.1.10/24"))}}, + QemuNetworkInterfaceID1: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))}}, + QemuNetworkInterfaceID2: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}}, + QemuNetworkInterfaceID3: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}, + QemuNetworkInterfaceID4: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.1.1"))}}, + QemuNetworkInterfaceID5: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))}}, + QemuNetworkInterfaceID6: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/48"))}}, + QemuNetworkInterfaceID7: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))}}, + QemuNetworkInterfaceID8: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID9: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, + QemuNetworkInterfaceID10: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, + QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::1"))}}, + QemuNetworkInterfaceID12: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))}}, + QemuNetworkInterfaceID13: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{SLAAC: true}}, + QemuNetworkInterfaceID14: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("")), + Gateway: util.Pointer(IPv4Address(""))}, + IPv6: &CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + Gateway: util.Pointer(IPv6Address(""))}}, + QemuNetworkInterfaceID20: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("")), + Gateway: util.Pointer(IPv4Address(""))}, + IPv6: &CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + Gateway: util.Pointer(IPv6Address(""))}}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: cloudInitNetworkConfig(), + QemuNetworkInterfaceID1: cloudInitNetworkConfig(), + QemuNetworkInterfaceID2: cloudInitNetworkConfig(), + QemuNetworkInterfaceID3: cloudInitNetworkConfig(), + QemuNetworkInterfaceID4: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}}, + QemuNetworkInterfaceID5: cloudInitNetworkConfig(), + QemuNetworkInterfaceID6: cloudInitNetworkConfig(), + QemuNetworkInterfaceID7: cloudInitNetworkConfig(), + QemuNetworkInterfaceID8: cloudInitNetworkConfig(), + QemuNetworkInterfaceID9: cloudInitNetworkConfig(), + QemuNetworkInterfaceID10: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{SLAAC: true}}, + QemuNetworkInterfaceID12: cloudInitNetworkConfig(), + QemuNetworkInterfaceID13: cloudInitNetworkConfig(), + QemuNetworkInterfaceID14: cloudInitNetworkConfig(), + QemuNetworkInterfaceID29: cloudInitNetworkConfig(), + QemuNetworkInterfaceID30: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}}}}, + output: map[string]interface{}{ + "ipconfig0": "ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", + "ipconfig1": "gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", + "ipconfig2": "ip=dhcp,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", + "ipconfig3": "ip=192.168.56.30/24,gw=192.168.1.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", + "ipconfig4": "gw=192.168.1.1", + "ipconfig5": "ip=192.168.56.30/24,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1", + "ipconfig6": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:85a3::/48,gw6=2001:0db8:abcd::1", + "ipconfig7": "ip=192.168.56.30/24,gw=192.168.56.1,gw6=2001:0db8:abcd::1", + "ipconfig8": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=dhcp", + "ipconfig9": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:85a3::1", + "ipconfig10": "gw6=2001:0db8:85a3::1", + "ipconfig11": "gw6=2001:0db8:85a3::1", + "ipconfig12": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48", + "ipconfig13": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=auto", + "delete": "ipconfig14"}}, + {name: `CloudInit PublicSSHkeys`, + config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, + output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, + {name: `CloudInit PublicSSHkeys empty`, + config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, + output: map[string]interface{}{"delete": "sshkeys"}}, + {name: `CloudInit UpgradePackages`, + config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(true)}}, + output: map[string]interface{}{"ciupgrade": 0}}, + {name: `CloudInit UserPassword`, + config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Abc123!")}}, + output: map[string]interface{}{"cipassword": "Enter123!"}}, + {name: `CloudInit Username`, + config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, + output: map[string]interface{}{"ciuser": "root"}}, + {name: `CloudInit Username empty`, + config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, + output: map[string]interface{}{"delete": "ciuser"}}}}, + {category: `Disks.Ide`, + update: []test{ + {name: `Disk.Ide.Disk_X DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, + output: map[string]interface{}{"delete": "ide0"}}}}, + {category: `Disks.Ide.CdRom`, + create: []test{ + {name: `Disks.Ide.Disk_X.CdRom none`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"ide0": "none,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom.Iso`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"ide1": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom.Passthrough`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"ide2": "cdrom,media=cdrom"}}}, + update: []test{ + {name: `Disks.Ide.Disk_X.CdRom CHANGE ISO TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"ide1": "none,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom CHANGE ISO TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"ide2": "cdrom,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom CHANGE None TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"ide3": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom CHANGE None TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"ide0": "cdrom,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom CHANGE Passthrough TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"ide1": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom CHANGE Passthrough TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"ide2": "none,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{}}}}, + output: map[string]interface{}{"delete": "ide3"}}, + {name: `Disks.Ide.Disk_X.CdRom SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.CdRom.Iso.File CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"ide1": "Test:iso/test2.iso,media=cdrom"}}, + {name: `Disks.Ide.Disk_X.CdRom.Iso.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, + output: map[string]interface{}{"ide2": "NewStorage:iso/test.iso,media=cdrom"}}}}, + {category: `Disks.Ide.CloudInit`, + create: []test{ + {name: `Disks.Ide.Disk_X.CloudInit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + output: map[string]interface{}{"ide1": "Test:cloudinit,format=raw"}}}, + update: []test{ + {name: `Disks.Ide.Disk_X.CloudInit DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{}}}}, + output: map[string]interface{}{"delete": "ide3"}}, + {name: `Disks.Ide.Disk_X.CloudInit SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: update_CloudInit()}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.CloudInit.Format CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, + output: map[string]interface{}{"ide1": "Test:cloudinit,format=qcow2"}}, + {name: `Disks.Ide.Disk_X.CloudInit.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, + output: map[string]interface{}{"ide2": "NewStorage:cloudinit,format=raw"}}}}, + {category: `Disks.Ide.Disk`, + create: []test{ + {name: `Disks.Ide.Disk_X.Disk All`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + EmulateSSD: true, + Format: format_Raw, + Replicate: true, + Serial: "558485ef-478", + SizeInKibibytes: 33554432, + Storage: "Test", + WorldWideName: "0x5000D31000C9876F"}}}}}, + output: map[string]interface{}{"ide0": "Test:32,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=558485ef-478,ssd=1,wwn=0x5000D31000C9876F"}}, + {name: `Disks.Ide.Disk_X.Disk Create Gibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 33554432, + Storage: "Test"}}}}}, + output: map[string]interface{}{"ide0": "Test:32,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk Create Kibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 33554433, + Storage: "Test"}}}}}, + output: map[string]interface{}{"ide0": "Test:0.001,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, + output: map[string]interface{}{"ide1": ",aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Backup: true}}}}}, + output: map[string]interface{}{"ide2": ",replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Cache: QemuDiskCache_DirectSync}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,cache=directsync,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Discard: true}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{EmulateSSD: true}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Ide.Disk_X.Disk.Format`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Format: format_Raw}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Replicate: true}}}}}, + output: map[string]interface{}{"ide1": ",backup=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Serial: "558485ef-478"}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,replicate=0,serial=558485ef-478"}}, + {name: `Disks.Ide.Disk_X.Disk.Size`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{SizeInKibibytes: 32}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Storage`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Storage: "Test"}}}}}, + output: map[string]interface{}{"ide0": "Test:0,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{WorldWideName: "0x5001234000F876AB"}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0,wwn=0x5001234000F876AB"}}}, + update: []test{ + {name: `Disks.Ide.Disk_X.Disk CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide3": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide3": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide3": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + syntax: diskSyntaxVolume, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide3": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: ideBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}}}, + output: map[string]interface{}{"delete": "ide0"}}, + {name: `Disks.Ide.Disk_X.Disk MIGRATE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"ide1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk MIGRATE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"ide1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk MIGRATE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"ide1": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk MIGRATE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"ide1": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Gibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Gibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Kibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Kibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE UP File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE UP File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE UP Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk RESIZE UP Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: ideBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk.Format CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide1": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Format CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"ide1": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Disk.Format CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Ide.Disk_X.Disk.Format CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.Ide.Passthrough`, + create: []test{ + {name: `Disks.Ide.Disk_X.Passthrough All`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "test-serial_757465-gdg", + WorldWideName: "0x500CBA2000D76543"}}}}}, + output: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=test-serial_757465-gdg,ssd=1,wwn=0x500CBA2000D76543"}}, + {name: `Disks.Ide.Disk_X.Passthrough.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, + output: map[string]interface{}{"ide1": ",aio=threads,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Backup: true}}}}}, + output: map[string]interface{}{"ide2": ",replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"ide1": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Cache: QemuDiskCache_Unsafe}}}}}, + output: map[string]interface{}{"ide2": ",backup=0,cache=unsafe,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Discard: true}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{EmulateSSD: true}}}}}, + output: map[string]interface{}{"ide0": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Ide.Disk_X.Passthrough.File`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, + output: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Replicate: true}}}}}, + output: map[string]interface{}{"ide2": ",backup=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Serial: "test-serial_757465-gdg"}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}}, + {name: `Disks.Ide.Disk_X.Passthrough.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{WorldWideName: "0x500FED1000B65432"}}}}}, + output: map[string]interface{}{"ide3": ",backup=0,replicate=0,wwn=0x500FED1000B65432"}}}, + update: []test{ + {name: `Disks.Ide.Disk_X.Passthrough CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{"ide0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Ide.Disk_X.Passthrough SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.Sata`, + update: []test{ + {name: `Disks.Sata.Disk_X DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}}}, + output: map[string]interface{}{"delete": "sata0"}}}}, + {category: `Disks.Sata.CdRom`, + create: []test{ + {name: `Disks.Sata.Disk_X.CdRom none`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"sata0": "none,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom.Iso`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"sata1": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom.Passthrough`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"sata2": "cdrom,media=cdrom"}}}, + update: []test{ + {name: `Disks.Sata.Disk_X.CdRom CHANGE ISO TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"sata1": "none,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom CHANGE ISO TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"sata2": "cdrom,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom CHANGE None TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"sata3": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom CHANGE None TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"sata4": "cdrom,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom CHANGE Passthrough TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"sata5": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom CHANGE Passthrough TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"sata0": "none,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{}}}}, + output: map[string]interface{}{"delete": "sata1"}}, + {name: `Disks.Sata.Disk_X.CdRom SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.CdRom.Iso.File CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"sata3": "Test:iso/test2.iso,media=cdrom"}}, + {name: `Disks.Sata.Disk_X.CdRom.Iso.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, + output: map[string]interface{}{"sata4": "NewStorage:iso/test.iso,media=cdrom"}}}}, + {category: `Disks.Sata.CloudInit`, + create: []test{ + {name: `Disks.Sata.Disk_X.CloudInit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + output: map[string]interface{}{"sata1": "Test:cloudinit,format=raw"}}}, + update: []test{ + {name: `Disks.Sata.Disk_X.CloudInit DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{}}}}, + output: map[string]interface{}{"delete": "sata5"}}, + {name: `Disks.Sata.Disk_X.CloudInit SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: update_CloudInit()}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.CloudInit.Format CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, + output: map[string]interface{}{"sata1": "Test:cloudinit,format=qcow2"}}, + {name: `Disks.Sata.Disk_X.CloudInit.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, + output: map[string]interface{}{"sata2": "NewStorage:cloudinit,format=raw"}}}}, + {category: `Disks.Sata.Disk`, + create: []test{ + {name: `Disks.Sata.Disk_X.Disk ALL`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Replicate: true, + Serial: "ab_C-12_3", + SizeInKibibytes: 16777216, + Storage: "Test", + WorldWideName: "0x5009876000A321DC"}}}}}, + output: map[string]interface{}{"sata0": "Test:16,aio=native,cache=unsafe,discard=on,format=qcow2,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=ab_C-12_3,ssd=1,wwn=0x5009876000A321DC"}}, + {name: `Disks.Sata.Disk_X.Disk Create Gibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 16777216, + Storage: "Test"}}}}}, + output: map[string]interface{}{"sata0": "Test:16,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk Create Kibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 16777217, + Storage: "Test"}}}}}, + output: map[string]interface{}{"sata0": "Test:0.001,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, + output: map[string]interface{}{"sata0": ",aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Backup: true}}}}}, + output: map[string]interface{}{"sata1": ",replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Cache: QemuDiskCache_DirectSync}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,cache=directsync,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Discard: true}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{EmulateSSD: true}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Sata.Disk_X.Disk.Format`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Format: format_Raw}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,format=raw,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Replicate: true}}}}}, + output: map[string]interface{}{"sata2": ",backup=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Serial: "558485ef-478"}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,replicate=0,serial=558485ef-478"}}, + {name: `Disks.Sata.Disk_X.Disk.Size`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{SizeInKibibytes: 32}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Storage`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Storage: "Test"}}}}}, + output: map[string]interface{}{"sata5": "Test:0,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{WorldWideName: "0x500DCBA500E23456"}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,replicate=0,wwn=0x500DCBA500E23456"}}}, + update: []test{ + {name: `Disks.Sata.Disk_X.Disk CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: sataBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{}}}}, + output: map[string]interface{}{"delete": "sata4"}}, + {name: `Disks.Sata.Disk_X.Disk MIGRATE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"sata5": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk MIGRATE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"sata5": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk MIGRATE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"sata5": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk MIGRATE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"sata5": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Gibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Gibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:9,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:9,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Kibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Kibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:0.001,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata0": "test:0.001,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE UP File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE UP File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE UP Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk RESIZE UP Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: sataBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk.Format CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Format CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"sata3": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Disk.Format CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Sata.Disk_X.Disk.Format CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.Sata.Passthrough`, + create: []test{ + {name: `Disks.Sata.Disk_X.Passthrough All`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "test-serial_757465-gdg", + WorldWideName: "0x5007892000C4321A"}}}}}, + output: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,serial=test-serial_757465-gdg,ssd=1,wwn=0x5007892000C4321A"}}, + {name: `Disks.Sata.Disk_X.Passthrough.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, + output: map[string]interface{}{"sata1": ",aio=threads,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Backup: true}}}}}, + output: map[string]interface{}{"sata2": ",replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"sata3": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"sata4": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, + output: map[string]interface{}{"sata0": ",backup=0,cache=unsafe,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Discard: true}}}}}, + output: map[string]interface{}{"sata1": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{EmulateSSD: true}}}}}, + output: map[string]interface{}{"sata2": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Sata.Disk_X.Passthrough.File`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, + output: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Replicate: true}}}}}, + output: map[string]interface{}{"sata4": ",backup=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Serial: "test-serial_757465-gdg"}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}}, + {name: `Disks.Sata.Disk_X.Passthrough.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{WorldWideName: "0x5001ABE000987654"}}}}}, + output: map[string]interface{}{"sata5": ",backup=0,replicate=0,wwn=0x5001ABE000987654"}}}, + update: []test{ + {name: `Disks.Sata.Disk_X.Passthrough CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{"sata0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Sata.Disk_X.Passthrough SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.Scsi`, + update: []test{ + {name: `Disks.Scsi.Disk_X DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}}}, + output: map[string]interface{}{"delete": "scsi0"}}}}, + {category: `Disks.Scsi.CdRom`, + create: []test{ + {name: `Disks.Scsi.CdRom none`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"scsi0": "none,media=cdrom"}}, + {name: `Disks.Scsi.CdRom.Iso`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"scsi1": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Scsi.CdRom.Passthrough`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"scsi2": "cdrom,media=cdrom"}}}, + update: []test{ + {name: `Disks.Scsi.Disk_X.CdRom CHANGE ISO TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"scsi1": "none,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom CHANGE ISO TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"scsi2": "cdrom,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom CHANGE None TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"scsi3": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom CHANGE None TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"scsi4": "cdrom,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom CHANGE Passthrough TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"scsi5": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom CHANGE Passthrough TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"scsi6": "none,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{}}}}, + output: map[string]interface{}{"delete": "scsi7"}}, + {name: `Disks.Scsi.Disk_X.CdRom SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.CdRom.Iso.File CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"scsi9": "Test:iso/test2.iso,media=cdrom"}}, + {name: `Disks.Scsi.Disk_X.CdRom.Iso.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, + output: map[string]interface{}{"scsi10": "NewStorage:iso/test.iso,media=cdrom"}}}}, + {category: `Disks.Scsi.CloudInit`, + create: []test{ + {name: `Disks.Scsi.CloudInit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + output: map[string]interface{}{"scsi1": "Test:cloudinit,format=raw"}}}, + update: []test{ + {name: `Disks.Scsi.Disk_X.CloudInit DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{}}}}, + output: map[string]interface{}{"delete": "scsi11"}}, + {name: `Disks.Scsi.Disk_X.CloudInit SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{CloudInit: update_CloudInit()}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.CloudInit.Format CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, + output: map[string]interface{}{"scsi13": "Test:cloudinit,format=qcow2"}}, + {name: `Disks.Scsi.Disk_X.CloudInit.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, + output: map[string]interface{}{"scsi14": "NewStorage:cloudinit,format=raw"}}}}, + {category: `Disks.Scsi.Disk`, + create: []test{ + {name: `Disks.Scsi.Disk_X.Disk All`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + EmulateSSD: true, + Format: format_Raw, + IOThread: true, + ReadOnly: true, + Replicate: true, + Serial: "558485ef-478", + SizeInKibibytes: 76546048, + Storage: "Test", + WorldWideName: "0x500D567800BAC321"}}}}}, + output: map[string]interface{}{"scsi0": "Test:73,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=558485ef-478,ssd=1,wwn=0x500D567800BAC321"}}, + {name: `Disks.Scsi.Disk_X.Disk Create Gibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ + SizeInKibibytes: 76546048, + Storage: "Test"}}}}}, + output: map[string]interface{}{"scsi0": "Test:73,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk Create Kibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ + SizeInKibibytes: 76546049, + Storage: "Test"}}}}}, + output: map[string]interface{}{"scsi0": "Test:0.001,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, + output: map[string]interface{}{"scsi1": ",aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{Backup: true}}}}}, + output: map[string]interface{}{"scsi2": ",replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"scsi3": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi11": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi12": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"scsi14": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi15": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"scsi17": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"scsi4": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi5": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"scsi6": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"scsi7": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi8": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"scsi9": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"scsi10": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{Cache: QemuDiskCache_DirectSync}}}}}, + output: map[string]interface{}{"scsi18": ",backup=0,cache=directsync,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{Discard: true}}}}}, + output: map[string]interface{}{"scsi19": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{EmulateSSD: true}}}}}, + output: map[string]interface{}{"scsi20": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Scsi.Disk_X.Disk.Format`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{Format: format_Raw}}}}}, + output: map[string]interface{}{"scsi20": ",backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.IOThread`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{IOThread: true}}}}}, + output: map[string]interface{}{"scsi21": ",backup=0,iothread=1,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.ReadOnly`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_22: &QemuScsiStorage{Disk: &QemuScsiDisk{ReadOnly: true}}}}}, + output: map[string]interface{}{"scsi22": ",backup=0,replicate=0,ro=1"}}, + {name: `Disks.Scsi.Disk_X.Disk.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{Disk: &QemuScsiDisk{Replicate: true}}}}}, + output: map[string]interface{}{"scsi23": ",backup=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_24: &QemuScsiStorage{Disk: &QemuScsiDisk{Serial: "558485ef-478"}}}}}, + output: map[string]interface{}{"scsi24": ",backup=0,replicate=0,serial=558485ef-478"}}, + {name: `Disks.Scsi.Disk_X.Disk.Size`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Disk: &QemuScsiDisk{SizeInKibibytes: 32}}}}}, + output: map[string]interface{}{"scsi25": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Storage`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_26: &QemuScsiStorage{Disk: &QemuScsiDisk{Storage: "Test"}}}}}, + output: map[string]interface{}{"scsi26": "Test:0,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_27: &QemuScsiStorage{Disk: &QemuScsiDisk{WorldWideName: "0x500EF32100D76589"}}}}}, + output: map[string]interface{}{"scsi27": ",backup=0,replicate=0,wwn=0x500EF32100D76589"}}}, + update: []test{ + {name: `Disks.Scsi.Disk_X.Disk CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi15": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi15": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi15": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi15": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: scsiBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{}}}}, + output: map[string]interface{}{"delete": "scsi16"}}, + {name: `Disks.Scsi.Disk_X.Disk MIGRATE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"scsi17": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk MIGRATE File Linked Clone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"scsi17": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk MIGRATE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"scsi17": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk MIGRATE Volume Linked Clone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"scsi17": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi18": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE UP File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE UP File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE UP Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk RESIZE UP Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: scsiBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk.Format CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi21": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Format CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"scsi21": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Disk.Format CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.Scsi.Disk_X.Disk.Format CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.Scsi.Passthrough`, + create: []test{ + {name: `Disks.Scsi.Disk_X.Passthrough All`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + ReadOnly: true, + Replicate: true, + Serial: "test-serial_757465-gdg", + WorldWideName: "0x500BCA3000F09876"}}}}}, + output: map[string]interface{}{"scsi0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=test-serial_757465-gdg,ssd=1,wwn=0x500BCA3000F09876"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, + output: map[string]interface{}{"scsi1": ",aio=threads,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Backup: true}}}}}, + output: map[string]interface{}{"scsi2": ",replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"scsi3": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"scsi11": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi12": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"scsi13": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"scsi14": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi15": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"scsi16": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"scsi17": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"scsi4": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi5": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"scsi6": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"scsi7": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"scsi8": ",backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"scsi9": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"scsi10": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, + output: map[string]interface{}{"scsi18": ",backup=0,cache=unsafe,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Discard: true}}}}}, + output: map[string]interface{}{"scsi19": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.EmulateSSD`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_20: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{EmulateSSD: true}}}}}, + output: map[string]interface{}{"scsi20": ",backup=0,replicate=0,ssd=1"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.File`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_21: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, + output: map[string]interface{}{"scsi21": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.IOThread`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_22: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{IOThread: true}}}}}, + output: map[string]interface{}{"scsi22": ",backup=0,iothread=1,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.ReadOnly`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ReadOnly: true}}}}}, + output: map[string]interface{}{"scsi23": ",backup=0,replicate=0,ro=1"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_24: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Replicate: true}}}}}, + output: map[string]interface{}{"scsi24": ",backup=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Serial: "test-serial_757465-gdg"}}}}}, + output: map[string]interface{}{"scsi25": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}}, + {name: `Disks.Scsi.Disk_X.Passthrough.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_25: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{WorldWideName: "0x5004DC0100E239C7"}}}}}, + output: map[string]interface{}{"scsi25": ",backup=0,replicate=0,wwn=0x5004DC0100E239C7"}}}, + update: []test{ + {name: `Disks.Scsi.Disk_X.Passthrough CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{"scsi0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}}, + {name: `Disks.Scsi.Disk_X.Passthrough SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.VirtIO`, + update: []test{ + {name: `Disks.VirtIO.Disk_X DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, + output: map[string]interface{}{"delete": "virtio0"}}}}, + {category: `Disks.VirtIO.CdRom`, + create: []test{ + {name: `Disks.VirtIO.Disk_X.CdRom none`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"virtio0": "none,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom.Iso`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"virtio1": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom.Passthrough`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"virtio2": "cdrom,media=cdrom"}}}, + update: []test{ + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE ISO TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"virtio1": "none,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE ISO TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"virtio2": "cdrom,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE None TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"virtio3": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE None TO Passthrough`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{"virtio4": "cdrom,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE Passthrough TO ISO`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"virtio5": "Test:iso/test.iso,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom CHANGE Passthrough TO None`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, + output: map[string]interface{}{"virtio6": "none,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{}}}}, + output: map[string]interface{}{"delete": "virtio7"}}, + {name: `Disks.VirtIO.Disk_X.CdRom SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.CdRom.Iso.File CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test2.iso", Storage: "Test"}}}}}}, + output: map[string]interface{}{"virtio9": "Test:iso/test2.iso,media=cdrom"}}, + {name: `Disks.VirtIO.Disk_X.CdRom.Iso.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "Test"}}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test.iso", Storage: "NewStorage"}}}}}}, + output: map[string]interface{}{"virtio10": "NewStorage:iso/test.iso,media=cdrom"}}}}, + {category: `Disks.VirtIO.CloudInit`, + create: []test{ + {name: `Disks.VirtIO.Disk_X.CloudInit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + output: map[string]interface{}{"virtio1": "Test:cloudinit,format=raw"}}}, + update: []test{ + {name: `Disks.VirtIO.Disk_X.CloudInit DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{}}}}, + output: map[string]interface{}{"delete": "virtio11"}}, + {name: `Disks.VirtIO.Disk_X.CloudInit SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{CloudInit: update_CloudInit()}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{CloudInit: update_CloudInit()}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.CloudInit.Format CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Qcow2, Storage: "Test"}}}}}, + output: map[string]interface{}{"virtio13": "Test:cloudinit,format=qcow2"}}, + {name: `Disks.VirtIO.Disk_X.CloudInit.Storage CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "Test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: format_Raw, Storage: "NewStorage"}}}}}, + output: map[string]interface{}{"virtio14": "NewStorage:cloudinit,format=raw"}}}}, + {category: `Disks.VirtIO.Disk`, + create: []test{ + {name: `Disks.VirtIO.Disk_X.Disk All`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + Format: format_Raw, + IOThread: true, + ReadOnly: true, + Replicate: true, + Serial: "558485ef-478", + SizeInKibibytes: 8238661632, + Storage: "Test", + WorldWideName: "0x500A7B0800F345D2"}}}}}, + output: map[string]interface{}{"virtio0": "Test:7857,aio=native,cache=directsync,discard=on,format=raw,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=558485ef-478,wwn=0x500A7B0800F345D2"}}, + {name: `Disks.VirtIO.Disk_X.Disk Create Gibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 8238661632, + Storage: "Test"}}}}}, + output: map[string]interface{}{"virtio0": "Test:7857,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk Create Kibibyte`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 8238661633, + Storage: "Test"}}}}}, + output: map[string]interface{}{"virtio0": "Test:0.001,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{AsyncIO: QemuDiskAsyncIO_Native}}}}}, + output: map[string]interface{}{"virtio1": ",aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Backup: true}}}}}, + output: map[string]interface{}{"virtio2": ",replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"virtio3": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"virtio11": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio12": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"virtio14": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio15": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"virtio1": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"virtio4": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio5": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 1}}}}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0,iops_rd_max_length=1,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"virtio7": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"virtio9": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}}}}}}, + output: map[string]interface{}{"virtio9": ",backup=0,iops_wr_max_length=2,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"virtio10": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Cache: QemuDiskCache_DirectSync}}}}}, + output: map[string]interface{}{"virtio2": ",backup=0,cache=directsync,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Discard: true}}}}}, + output: map[string]interface{}{"virtio3": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Format`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: format_Raw}}}}}, + output: map[string]interface{}{"virtio4": ",backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.IOThread`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{IOThread: true}}}}}, + output: map[string]interface{}{"virtio4": ",backup=0,iothread=1,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.ReadOnly`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ReadOnly: true}}}}}, + output: map[string]interface{}{"virtio5": ",backup=0,replicate=0,ro=1"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Replicate: true}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Serial: "558485ef-478"}}}}}, + output: map[string]interface{}{"virtio7": ",backup=0,replicate=0,serial=558485ef-478"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Size`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{SizeInKibibytes: 32}}}}}, + output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Storage`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Storage: "Test"}}}}}, + output: map[string]interface{}{"virtio9": "Test:0,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{WorldWideName: "0x5005FED000B87632"}}}}}, + output: map[string]interface{}{"virtio10": ",backup=0,replicate=0,wwn=0x5005FED000B87632"}}}, + update: []test{ + {name: `Disks.VirtIO.Disk_X.Disk CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio15": "test:0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio15": "test:100/base-100-disk-1.raw/0/vm-0-disk-23.raw,aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio15": "test:vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_Native, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio15": "test:base-100-disk-1/vm-0-disk-23,aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk DELETE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: virtioBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}, + output: map[string]interface{}{"delete": "virtio0"}}, + {name: `Disks.VirtIO.Disk_X.Disk MIGRATE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"virtio1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk MIGRATE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"virtio1": "test2:0/vm-0-disk-23.raw,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk MIGRATE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"virtio1": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk MIGRATE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test1", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 10, + Storage: "test2"}}}}}, + output: map[string]interface{}{"virtio1": "test2:vm-0-disk-23,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Gibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437185, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437184, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:9,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE DOWN Kibibyte Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 9437186, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 9437185, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio2": "test:0.001,backup=0,format=raw,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE UP File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE UP File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE UP Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk RESIZE UP Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + SizeInKibibytes: 11, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: virtioBase()}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk.Format CHANGE File`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio5": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Format CHANGE File LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{"virtio5": "test:0/vm-0-disk-23.qcow2,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Disk.Format CHANGE Volume`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}, + {name: `Disks.VirtIO.Disk_X.Disk.Format CHANGE Volume LinkedClone`, + currentConfig: ConfigQemu{ + LinkedVmId: 100, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Id: 23, + LinkedDiskId: &uint1, + SizeInKibibytes: 10, + Storage: "test", + syntax: diskSyntaxVolume}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 10, + Storage: "test"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Disks.VirtIO.Passthrough`, + create: []test{ + {name: `Disks.VirtIO.Disk_X.Passthrough All`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99, Concurrent: float10}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79, Concurrent: float45}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78, BurstDuration: 3, Concurrent: uint34}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89, BurstDuration: 4, Concurrent: uint23}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + ReadOnly: true, + Replicate: true, + Serial: "test-serial_757465-gdg", + WorldWideName: "0x500C329500A1EFAB"}}}}}, + output: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,cache=unsafe,discard=on,iops_rd=34,iops_rd_max=78,iops_rd_max_length=3,iops_wr=23,iops_wr_max=89,iops_wr_max_length=4,iothread=1,mbps_rd=10.3,mbps_rd_max=99.2,mbps_wr=45.23,mbps_wr_max=79.23,ro=1,serial=test-serial_757465-gdg,wwn=0x500C329500A1EFAB"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.AsyncIO`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{AsyncIO: QemuDiskAsyncIO_Threads}}}}}, + output: map[string]interface{}{"virtio1": ",aio=threads,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Backup`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Backup: true}}}}}, + output: map[string]interface{}{"virtio2": ",replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{}}}}}}, + output: map[string]interface{}{"virtio3": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{}}}}}}}, + output: map[string]interface{}{"virtio11": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio12": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: uint78}}}}}}}}, + output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max=78,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}}}}}}, + output: map[string]interface{}{"virtio13": ",backup=0,iops_rd_max_length=3,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint34}}}}}}}}, + output: map[string]interface{}{"virtio14": ",backup=0,iops_rd=34,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio15": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: uint89}}}}}}}}, + output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max=89,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.BurstDuration`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 4}}}}}}}}, + output: map[string]interface{}{"virtio0": ",backup=0,iops_wr_max_length=4,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.Iops.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: uint23}}}}}}}}, + output: map[string]interface{}{"virtio1": ",backup=0,iops_wr=23,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{}}}}}}}, + output: map[string]interface{}{"virtio4": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio5": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: float99}}}}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0,mbps_rd_max=99.2,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.ReadLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float10}}}}}}}}, + output: map[string]interface{}{"virtio7": ",backup=0,mbps_rd=10.3,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{}}}}}}}}, + output: map[string]interface{}{"virtio8": ",backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Burst`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: float79}}}}}}}}, + output: map[string]interface{}{"virtio9": ",backup=0,mbps_wr_max=79.23,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Bandwidth.MBps.WriteLimit.Concurrent`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: float45}}}}}}}}, + output: map[string]interface{}{"virtio10": ",backup=0,mbps_wr=45.23,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Cache`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Cache: QemuDiskCache_Unsafe}}}}}, + output: map[string]interface{}{"virtio2": ",backup=0,cache=unsafe,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Discard`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Discard: true}}}}}, + output: map[string]interface{}{"virtio3": ",backup=0,discard=on,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.File`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}}}}}, + output: map[string]interface{}{"virtio4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.IOThread`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{IOThread: true}}}}}, + output: map[string]interface{}{"virtio5": ",backup=0,iothread=1,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.ReadOnly`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ReadOnly: true}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0,replicate=0,ro=1"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Replicate`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Replicate: true}}}}}, + output: map[string]interface{}{"virtio6": ",backup=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.Serial`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Serial: "test-serial_757465-gdg"}}}}}, + output: map[string]interface{}{"virtio7": ",backup=0,replicate=0,serial=test-serial_757465-gdg"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough.WorldWideName`, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{WorldWideName: "0x500D41A600C67853"}}}}}, + output: map[string]interface{}{"virtio8": ",backup=0,replicate=0,wwn=0x500D41A600C67853"}}}, + update: []test{ + {name: `Disks.VirtIO.Disk_X.Passthrough CHANGE`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{"virtio0": "/dev/disk/sda,aio=native,backup=0,replicate=0"}}, + {name: `Disks.VirtIO.Disk_X.Passthrough SAME`, + currentConfig: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + File: "/dev/disk/sda"}}}}}, + config: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + File: "/dev/disk/sda"}}}}}, + output: map[string]interface{}{}}}}, + {category: `Iso`, + create: []test{ + {name: `Iso`, + config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + output: map[string]interface{}{"ide2": "test:iso/file.iso,media=cdrom"}}}, + update: []test{ + {name: `Iso nil`, + currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + config: &ConfigQemu{Iso: nil}, + output: map[string]interface{}{}}, + {name: `Iso SAME`, + currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + output: map[string]interface{}{"ide2": "test:iso/file.iso,media=cdrom"}}, + {name: `Iso.File`, + currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + config: &ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file2.iso"}}, + output: map[string]interface{}{"ide2": "test:iso/file2.iso,media=cdrom"}}, + {name: `Iso.Storage`, + currentConfig: ConfigQemu{Iso: &IsoFile{Storage: "test", File: "file.iso"}}, + config: &ConfigQemu{Iso: &IsoFile{Storage: "NewStorage", File: "file.iso"}}, + output: map[string]interface{}{"ide2": "NewStorage:iso/file.iso,media=cdrom"}}}}, + {category: `Tags`, + create: []test{ + {name: `Tags Empty`, + config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, + output: map[string]interface{}{"tags": string("")}}, + {name: `Tags Full`, + config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, + output: map[string]interface{}{"tags": string("tag1;tag2")}}}, + update: []test{ + {name: `Update Tags Empty`, + config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, + output: map[string]interface{}{"tags": string("")}}, + {name: `Update Tags Full`, + config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, + output: map[string]interface{}{"tags": string("tag1;tag2")}}}}, + {category: `TPM`, + create: []test{ + {name: `TPM`, + config: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0)}}, + output: map[string]interface{}{"tpmstate0": "test:1,version=v2.0"}}}, + update: []test{ + {name: `TPM`, + config: &ConfigQemu{TPM: &TpmState{Storage: "aaaa", Version: util.Pointer(TpmVersion_1_2)}}, + currentConfig: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0)}}, + output: map[string]interface{}{}}, + {name: `TPM Delete`, + config: &ConfigQemu{TPM: &TpmState{Delete: true}}, + output: map[string]interface{}{"delete": "tpmstate0"}}, + {name: `TPM Delete Full`, + config: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion_2_0), Delete: true}}, + output: map[string]interface{}{"delete": "tpmstate0"}}}}, } for _, test := range tests { - t.Run(test.name, func(*testing.T) { - reboot, tmpParams, _ := test.config.mapToApiValues(test.currentConfig) - require.Equal(t, test.output, tmpParams, test.name) - require.Equal(t, test.reboot, reboot, test.name) - }) + for _, subTest := range test.create { + create(t, test.category, subTest) + } + for _, subTest := range test.createUpdate { + create(t, test.category, subTest) + update(t, test.category, subTest) + } + for _, subTest := range test.update { + update(t, test.category, subTest) + } } } From 75db7a401ef2454d8f43123169d4bfa6975a567e Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:43:04 +0200 Subject: [PATCH 2/6] refactor: make test easier to navigate --- proxmox/config_qemu_test.go | 4883 ++++++++++++++++------------------- 1 file changed, 2203 insertions(+), 2680 deletions(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index 75e30219..ecaf4e16 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -3218,2697 +3218,2220 @@ func Test_ConfigQemu_mapToStruct(t *testing.T) { uint31 := uint(31) uint47 := uint(47) uint53 := uint(53) - tests := []struct { + type test struct { name string input map[string]interface{} vmr *VmRef output *ConfigQemu err error + } + tests := []struct { + category string + tests []test }{ // TODO add test cases for all other items of ConfigQemu{} - {name: `Agent ALL`, - input: map[string]interface{}{"agent": string("1,freeze-fs-on-backup=1,fstrim_cloned_disks=1,type=virtio")}, - output: &ConfigQemu{Agent: &QemuGuestAgent{ - Enable: util.Pointer(true), - Freeze: util.Pointer(true), - FsTrim: util.Pointer(true), - Type: util.Pointer(QemuGuestAgentType_VirtIO), - }}}, - {name: `Agent Enabled`, - input: map[string]interface{}{"agent": string("1")}, - output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}}, - {name: `Agent Freeze`, - input: map[string]interface{}{"agent": string("0,freeze-fs-on-backup=1")}, - output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(false), Freeze: util.Pointer(true)}}}, - {name: `Agent FsTrim`, - input: map[string]interface{}{"agent": string("0,fstrim_cloned_disks=1")}, - output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(false), FsTrim: util.Pointer(true)}}}, - {name: `Agent Type`, - input: map[string]interface{}{"agent": string("1,type=virtio")}, - output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true), Type: util.Pointer(QemuGuestAgentType_VirtIO)}}}, - // CloudInit - {name: `CloudInit ALL`, - input: map[string]interface{}{ - "cicustom": string("meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"), - "searchdomain": string("example.com"), - "nameserver": string("1.1.1.1 8.8.8.8 9.9.9.9"), - "ipconfig0": string("ip=dhcp,ip6=dhcp"), - "ipconfig19": string(""), - "ipconfig31": string("ip=10.20.4.7/22"), - "sshkeys": test_data_qemu.PublicKey_Encoded_Input(), - "ciupgrade": float64(1), - "cipassword": string("Enter123!"), - "ciuser": string("root")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{ - FilePath: "ci-meta.yml", - Storage: "local-zfs"}, - Network: &CloudInitSnippet{ - FilePath: "ci-network.yml", - Storage: "local-lvm"}, - User: &CloudInitSnippet{ - FilePath: "ci-user.yml", - Storage: "folder"}, - Vendor: &CloudInitSnippet{ - FilePath: "snippets/ci-custom.yml", - Storage: "local"}}, - DNS: &GuestDNS{ - SearchDomain: util.Pointer("example.com"), - NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, - NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID31: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}, - PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Output()), - UpgradePackages: util.Pointer(true), - UserPassword: util.Pointer("Enter123!"), - Username: util.Pointer("root")}}}, - {name: `CloudInit Custom Meta`, - input: map[string]interface{}{"cicustom": string("meta=local-zfs:ci-meta.yml")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{Meta: &CloudInitSnippet{FilePath: "ci-meta.yml", Storage: "local-zfs"}}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit Custom Network`, - input: map[string]interface{}{"cicustom": string("network=local-lvm:ci-network.yml")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{Network: &CloudInitSnippet{FilePath: "ci-network.yml", Storage: "local-lvm"}}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit Custom User`, - input: map[string]interface{}{ - "cicustom": string("user=folder:ci-user.yml")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{User: &CloudInitSnippet{FilePath: "ci-user.yml", Storage: "folder"}}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit Custom Vendor`, - input: map[string]interface{}{"cicustom": string("vendor=local:snippets/ci-custom.yml")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - Custom: &CloudInitCustom{Vendor: &CloudInitSnippet{FilePath: "snippets/ci-custom.yml", Storage: "local"}}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit DNS SearchDomain`, - input: map[string]interface{}{"searchdomain": string("example.com")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - DNS: &GuestDNS{ - SearchDomain: util.Pointer("example.com"), - NameServers: util.Pointer(uninitializedArray[netip.Addr]())}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit DNS SearchDomain empty`, - input: map[string]interface{}{"searchdomain": string(" ")}, - output: &ConfigQemu{}}, - {name: `CloudInit DNS NameServers`, - input: map[string]interface{}{"nameserver": string("1.1.1.1 8.8.8.8 9.9.9.9")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - DNS: &GuestDNS{ - SearchDomain: util.Pointer(""), - NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, - NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, - {name: `CloudInit NetworkInterfaces`, - input: map[string]interface{}{ - - "ipconfig0": string("ip=dhcp,ip6=dhcp"), - "ipconfig1": string("ip6=auto"), - "ipconfig2": string("ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"), - "ipconfig19": string(""), - "ipconfig20": string(" "), // this single space is on porpuse to test if it is ignored - "ipconfig31": string("ip=10.20.4.7/22")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{DHCP: true}, - IPv6: &CloudInitIPv6Config{DHCP: true}}, - QemuNetworkInterfaceID1: CloudInitNetworkConfig{ - IPv6: &CloudInitIPv6Config{SLAAC: true}}, - QemuNetworkInterfaceID2: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("192.168.1.10/24")), - Gateway: util.Pointer(IPv4Address("192.168.56.1"))}, - IPv6: &CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("2001:0db8:abcd::/48")), - Gateway: util.Pointer(IPv6Address("2001:0db8:abcd::1"))}}, - QemuNetworkInterfaceID31: CloudInitNetworkConfig{ - IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}}}}, - {name: `CloudInit PublicSSHkeys`, - input: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Input()}, - output: &ConfigQemu{CloudInit: &CloudInit{ - NetworkInterfaces: CloudInitNetworkInterfaces{}, - PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Output())}}}, - {name: `CloudInit UpgradePackages`, - input: map[string]interface{}{"ciupgrade": float64(0)}, - output: &ConfigQemu{CloudInit: &CloudInit{ - NetworkInterfaces: CloudInitNetworkInterfaces{}, - UpgradePackages: util.Pointer(false)}}}, - {name: `CloudInit UserPassword`, - input: map[string]interface{}{"cipassword": string("Enter123!")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - NetworkInterfaces: CloudInitNetworkInterfaces{}, - UserPassword: util.Pointer("Enter123!")}}}, - {name: `CloudInit Username`, - input: map[string]interface{}{"ciuser": string("root")}, - output: &ConfigQemu{CloudInit: &CloudInit{ - NetworkInterfaces: CloudInitNetworkInterfaces{}, - Username: util.Pointer("root")}}}, - {name: `CloudInit Username empty`, - input: map[string]interface{}{"ciuser": string(" ")}, - output: &ConfigQemu{}}, - // Disks Ide CdRom - {name: "Disks Ide CdRom none", - input: map[string]interface{}{"ide1": "none,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}, - }, - {name: "Disks Ide CdRom passthrough", - input: map[string]interface{}{"ide2": "cdrom,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - }, - {name: "Disks Ide CdRom iso", - input: map[string]interface{}{"ide3": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ - File: "debian-11.0.0-amd64-netinst.iso", - Storage: "local", - SizeInKibibytes: "377M", - }}}}}}, - }, - // Disks Ide CloudInit - {name: "Disks Ide CloudInit file", - input: map[string]interface{}{"ide0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - {name: "Disks Ide CloudInit lvm", - input: map[string]interface{}{"ide3": "Test:vm-100-cloudinit,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - // Disks Ide Disk - {name: "Disks Ide Disk", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk ALL", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,aio=io_uring,backup=0,cache=writethrough,discard=on,iops_rd=12,iops_rd_max=13,iops_rd_max_length=4,iops_wr=15,iops_wr_max=14,iops_wr_max_length=5,mbps_rd=1.46,mbps_rd_max=3.57,mbps_wr=2.68,mbps_wr_max=4.55,replicate=0,serial=disk-9763,size=1032G,ssd=1,wwn=0x500F753600A987E1"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57, Concurrent: 1.46}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55, Concurrent: 2.68}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 12}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14, BurstDuration: 5, Concurrent: 15}, - }, - }, - Cache: QemuDiskCache_WriteThrough, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1082130432, - Storage: "test2", - WorldWideName: "0x500F753600A987E1", - }}}}}, - }, - {name: "Disks Ide Disk ALL LinkedClone", - input: map[string]interface{}{"ide1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-53.qcow2,aio=io_uring,backup=0,cache=writethrough,discard=on,iops_rd=12,iops_rd_max=13,iops_rd_max_length=4,iops_wr=15,iops_wr_max=14,iops_wr_max_length=5,mbps_rd=1.46,mbps_rd_max=3.57,mbps_wr=2.68,mbps_wr_max=4.55,replicate=0,serial=disk-9763,size=1032G,ssd=1,wwn=0x500679CE00B1DAF4"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57, Concurrent: 1.46}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55, Concurrent: 2.68}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 12}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14, BurstDuration: 5, Concurrent: 15}, - }, - }, - Cache: QemuDiskCache_WriteThrough, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - LinkedDiskId: &uint1, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1082130432, - Storage: "test2", - WorldWideName: "0x500679CE00B1DAF4", - }}}}}, - }, - {name: "Disks Ide Disk aio", - input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,aio=io_uring"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk backup", - input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: false, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk cache", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,cache=writethrough"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Cache: QemuDiskCache_WriteThrough, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk discard", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_rd", - input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,iops_rd=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 12}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_rd_max", - input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,iops_rd_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_rd_max_length", - input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_wr", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,iops_wr=15"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 15}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_wr_max", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,iops_wr_max=14"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk iops_wr_max_length", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk mbps_rd", - input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,mbps_rd=1.46"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.46}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk mbps_rd_max", - input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,mbps_rd_max=3.57"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk mbps_wr", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,mbps_wr=2.68"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.68}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk mbps_wr_max", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,mbps_wr_max=4.55"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk replicate", - input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: false, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk serial", - input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Serial: "disk-9763", - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk size G", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032G"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - SizeInKibibytes: 1082130432, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk size K", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032K"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - SizeInKibibytes: 1032, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk size M", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032M"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - SizeInKibibytes: 1056768, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk size T", - input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=2T"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - SizeInKibibytes: 2147483648, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk ssd", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Ide Disk syntax fileSyntaxVolume", - input: map[string]interface{}{"ide2": "test:vm-100-disk-2"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Ide Disk syntax fileSyntaxVolume LinkedClone", - input: map[string]interface{}{"ide3": "test:base-110-disk-1/vm-100-disk-2"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - LinkedDiskId: &uint1, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Ide Disk wwn", - input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,wwn=0x500DB82100C6FA59"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint53, - Replicate: true, - Storage: "test2", - WorldWideName: "0x500DB82100C6FA59", - }}}}}, - }, - // Disks Ide Passthrough - {name: "Disks Ide Passthrough", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough All", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,backup=0,cache=unsafe,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=1G,ssd=1,wwn=0x500CBE4300D978A6"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1048576, - WorldWideName: "0x500CBE4300D978A6", - }}}}}, - }, - {name: "Disks Ide Passthrough aio", - input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough backup", - input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: false, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough cache", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=unsafe"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Cache: QemuDiskCache_Unsafe, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough discard", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_rd", - input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_rd_max", - input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_rd_max_length", - input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_wr", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_wr_max", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough iops_wr_max_length", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough mbps_rd", - input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough mbps_rd_max", - input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough mbps_wr", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough mbps_wr_max", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough replicate", - input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - }}}}}, - }, - {name: "Disks Ide Passthrough serial", - input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "disk-9763", - }}}}}, - }, - {name: "Disks Ide Passthrough size G", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10G"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 10485760, - }}}}}, - }, - {name: "Disks Ide Passthrough size K", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10K"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 10, - }}}}}, - }, - {name: "Disks Ide Passthrough size M", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10M"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 10240, - }}}}}, - }, - {name: "Disks Ide Passthrough size T", - input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10T"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 10737418240, - }}}}}, - }, - {name: "Disks Ide Passthrough ssd", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Ide Passthrough wwn", - input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5005AC1200F643B8"}, - output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - WorldWideName: "0x5005AC1200F643B8", - }}}}}, - }, - // Disks Sata CdRom - {name: "Disks Sata CdRom none", - input: map[string]interface{}{"sata5": "none,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}, - }, - {name: "Disks Sata CdRom passthrough", - input: map[string]interface{}{"sata4": "cdrom,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - }, - {name: "Disks Sata CdRom iso", - input: map[string]interface{}{"sata3": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ - File: "debian-11.0.0-amd64-netinst.iso", - Storage: "local", - SizeInKibibytes: "377M", - }}}}}}, - }, - // Disks Sata CloudInit - {name: "Disks Sata CloudInit file", - input: map[string]interface{}{"sata4": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - {name: "Disks Sata CloudInit lvm", - input: map[string]interface{}{"sata0": "Test:vm-100-cloudinit,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - // Disks Sata Disk - {name: "Disks Sata Disk", - input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk ALL", - input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,aio=native,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=32G,ssd=1,wwn=0x500DFA8900E3C641"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_None, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test2", - WorldWideName: "0x500DFA8900E3C641", - }}}}}, - }, - {name: "Disks Sata Disk ALL LinkedClone", - input: map[string]interface{}{"sata1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-47.qcow2,aio=native,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=32G,ssd=1,wwn=0x5003B97600A8F2D4"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_None, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - LinkedDiskId: &uint1, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test2", - WorldWideName: "0x5003B97600A8F2D4", - }}}}}, - }, - {name: "Disks Sata Disk aio", - input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,aio=native"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk backup", - input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: false, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk cache", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,cache=none"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Cache: QemuDiskCache_None, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk discard", - input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_rd", - input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_rd_max", - input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_rd_max_length", - input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_wr", - input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_wr_max", - input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk iops_wr_max_length", - input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk mbps_rd", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk mbps_rd_max", - input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk mbps_wr", - input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}, - }, - }, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk mbps_wr_max", - input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk replicate", - input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: false, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk serial", - input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Serial: "disk-9763", - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk size G", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32G"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - SizeInKibibytes: 33554432, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk size K", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32K"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - SizeInKibibytes: 32, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk size M", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32M"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - SizeInKibibytes: 32768, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk size T", - input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=3T"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - SizeInKibibytes: 3221225472, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk ssd", - input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks Sata Disk syntax fileSyntaxVolume", - input: map[string]interface{}{"sata0": "test:vm-100-disk-2"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Sata Disk syntax fileSyntaxVolume LinkedClone", - input: map[string]interface{}{"sata1": "test:base-110-disk-1/vm-100-disk-2"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - LinkedDiskId: &uint1, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Sata Disk wwn", - input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,wwn=0x5001E48A00D567C9"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint47, - Replicate: true, - Storage: "test2", - WorldWideName: "0x5001E48A00D567C9", - }}}}}, - }, - // Disks Sata Passthrough - {name: "Disks Sata Passthrough", - input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough All", - input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=5,iops_wr=11,iops_wr_max=13,iops_wr_max_length=4,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=1G,ssd=1,wwn=500E9FBC00F2A6D3"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 5, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1048576, - WorldWideName: "500E9FBC00F2A6D3", - }}}}}, - }, - {name: "Disks Sata Passthrough aio", - input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=io_uring"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough backup", - input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: false, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough cache", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=directsync"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Cache: QemuDiskCache_DirectSync, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough discard", - input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_rd", - input: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_rd_max", - input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_rd_max_length", - input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_wr", - input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_wr_max", - input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough iops_wr_max_length", - input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough mbps_rd", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough mbps_rd_max", - input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough mbps_wr", - input: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough mbps_wr_max", - input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough replicate", - input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - }}}}}, - }, - {name: "Disks Sata Passthrough serial", - input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "disk-9763", - }}}}}, - }, - {name: "Disks Sata Passthrough size G", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=3G"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 3145728, - }}}}}, - }, - {name: "Disks Sata Passthrough size K", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=5789K"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 5789, - }}}}}, - }, - {name: "Disks Sata Passthrough size M", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=45M"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 46080, - }}}}}, - }, - {name: "Disks Sata Passthrough size T", - input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=7T"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 7516192768, - }}}}}, - }, - {name: "Disks Sata Passthrough ssd", - input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Sata Passthrough wwn", - input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5004D2EF00C8B57A"}, - output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - WorldWideName: "0x5004D2EF00C8B57A", - }}}}}, - }, - // Disks Scsi CdRom - {name: "Disks Scsi CdRom none", - input: map[string]interface{}{"scsi30": "none,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_30: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}, - }, - {name: "Disks Scsi CdRom passthrough", - input: map[string]interface{}{"scsi29": "cdrom,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_29: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - }, - {name: "Disks Scsi CdRom iso", - input: map[string]interface{}{"scsi28": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_28: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ - File: "debian-11.0.0-amd64-netinst.iso", - Storage: "local", - SizeInKibibytes: "377M", - }}}}}}, - }, - // Disks Scsi CloudInit - {name: "Disks Scsi CloudInit file", - input: map[string]interface{}{"scsi0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - {name: "Disks Scsi CloudInit lvm", - input: map[string]interface{}{"scsi23": "Test:vm-100-cloudinit,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - // Disks Scsi Disk - {name: "Disks Scsi Disk", - input: map[string]interface{}{"scsi0": "test:100/vm-100-disk-2.qcow2"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk ALL", - input: map[string]interface{}{"scsi1": "test:100/vm-100-disk-2.qcow2,aio=threads,backup=0,cache=writeback,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,ssd=1,wwn=0x500AF18700E9CD25"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_WriteBack, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - IOThread: true, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test", - WorldWideName: "0x500AF18700E9CD25", - }}}}}, - }, - {name: "Disks Scsi Disk ALL LinkedClone", - input: map[string]interface{}{"scsi1": "test:110/base-110-disk-1.qcow2/100/vm-100-disk-2.qcow2,aio=threads,backup=0,cache=writeback,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,ssd=1,wwn=0x500879DC00F3BE6A"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_WriteBack, - Discard: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - IOThread: true, - LinkedDiskId: &uint1, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test", - WorldWideName: "0x500879DC00F3BE6A", - }}}}}, - }, - {name: "Disks Scsi Disk aio", - input: map[string]interface{}{"scsi2": "test:100/vm-100-disk-2.qcow2,aio=threads"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk backup", - input: map[string]interface{}{"scsi3": "test:100/vm-100-disk-2.qcow2,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: false, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk cache", - input: map[string]interface{}{"scsi4": "test:100/vm-100-disk-2.qcow2,cache=writeback"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Cache: QemuDiskCache_WriteBack, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk discard", - input: map[string]interface{}{"scsi5": "test:100/vm-100-disk-2.qcow2,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_rd", - input: map[string]interface{}{"scsi6": "test:100/vm-100-disk-2.qcow2,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_rd_max", - input: map[string]interface{}{"scsi7": "test:100/vm-100-disk-2.qcow2,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_rd_max_length", - input: map[string]interface{}{"scsi7": "test:100/vm-100-disk-2.qcow2,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_wr", - input: map[string]interface{}{"scsi8": "test:100/vm-100-disk-2.qcow2,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_wr_max", - input: map[string]interface{}{"scsi9": "test:100/vm-100-disk-2.qcow2,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iops_wr_max_length", - input: map[string]interface{}{"scsi9": "test:100/vm-100-disk-2.qcow2,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk iothread", - input: map[string]interface{}{"scsi10": "test:100/vm-100-disk-2.qcow2,iothread=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - IOThread: true, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk mbps_rd", - input: map[string]interface{}{"scsi11": "test:100/vm-100-disk-2.qcow2,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk mbps_rd_max", - input: map[string]interface{}{"scsi12": "test:100/vm-100-disk-2.qcow2,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk mbps_wr", - input: map[string]interface{}{"scsi13": "test:100/vm-100-disk-2.qcow2,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk mbps_wr_max", - input: map[string]interface{}{"scsi14": "test:100/vm-100-disk-2.qcow2,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk replicate", - input: map[string]interface{}{"scsi15": "test:100/vm-100-disk-2.qcow2,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: false, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk ro", - input: map[string]interface{}{"scsi16": "test:100/vm-100-disk-2.qcow2,ro=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - ReadOnly: true, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk serial", - input: map[string]interface{}{"scsi17": "test:100/vm-100-disk-2.qcow2,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Serial: "disk-9763", - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk size G", - input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32G"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - SizeInKibibytes: 33554432, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk size K", - input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32K"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - SizeInKibibytes: 32, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk size M", - input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32M"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - SizeInKibibytes: 32768, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk size T", - input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=4T"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - SizeInKibibytes: 4294967296, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk ssd", - input: map[string]interface{}{"scsi19": "test:100/vm-100-disk-2.qcow2,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - EmulateSSD: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - }}}}}, - }, - {name: "Disks Scsi Disk syntax fileSyntaxVolume", - input: map[string]interface{}{"scsi6": "test:vm-100-disk-2"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Scsi Disk syntax fileSyntaxVolume LinkedClone", - input: map[string]interface{}{"scsi7": "test:base-110-disk-1/vm-100-disk-2"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - LinkedDiskId: &uint1, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks Scsi Disk wwn", - input: map[string]interface{}{"scsi19": "test:100/vm-100-disk-2.qcow2,wwn=0x500E265400A1F3D7"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint2, - Replicate: true, - Storage: "test", - WorldWideName: "0x500E265400A1F3D7", - }}}}}, - }, - // Disks Scsi Passthrough - {name: "Disks Scsi Passthrough", - input: map[string]interface{}{"scsi0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough All", - input: map[string]interface{}{"scsi1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=1G,ssd=1,wwn=500CB15600D8FE32"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_None, - Discard: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1048576, - WorldWideName: "500CB15600D8FE32", - }}}}}, - }, - {name: "Disks Scsi Passthrough aio", - input: map[string]interface{}{"scsi2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough backup", - input: map[string]interface{}{"scsi3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: false, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough cache", - input: map[string]interface{}{"scsi4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=none"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Cache: QemuDiskCache_None, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough discard", - input: map[string]interface{}{"scsi5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_rd", - input: map[string]interface{}{"scsi6": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_rd_max", - input: map[string]interface{}{"scsi7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_rd_max_length", - input: map[string]interface{}{"scsi7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_wr", - input: map[string]interface{}{"scsi8": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_wr_max", - input: map[string]interface{}{"scsi9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iops_wr_max_length", - input: map[string]interface{}{"scsi9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough iothread", - input: map[string]interface{}{"scsi10": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iothread=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough mbps_rd", - input: map[string]interface{}{"scsi11": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough mbps_rd_max", - input: map[string]interface{}{"scsi12": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough mbps_wr", - input: map[string]interface{}{"scsi13": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough mbps_wr_max", - input: map[string]interface{}{"scsi14": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough replicate", - input: map[string]interface{}{"scsi15": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - }}}}}, - }, - {name: "Disks Scsi Passthrough ro", - input: map[string]interface{}{"scsi16": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ro=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - ReadOnly: true, - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough serial", - input: map[string]interface{}{"scsi17": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "disk-9763", - }}}}}, - }, - {name: "Disks Scsi Passthrough size G", - input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1G"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1048576, - }}}}}, - }, - {name: "Disks Scsi Passthrough size K", - input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1K"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1, - }}}}}, - }, - {name: "Disks Scsi Passthrough size M", - input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1M"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1024, - }}}}}, - }, - {name: "Disks Scsi Passthrough size T", - input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1T"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1073741824, - }}}}}, - }, - {name: "Disks Scsi Passthrough ssd", - input: map[string]interface{}{"scsi19": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - EmulateSSD: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks Scsi Passthrough wwn", - input: map[string]interface{}{"scsi19": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5009A4FC00B7C613"}, - output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - WorldWideName: "0x5009A4FC00B7C613", - }}}}}, - }, - // VirtIO CdRom - {name: "Disks VirtIO CdRom none", - input: map[string]interface{}{"virtio11": "none,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}, - }, - {name: "Disks VirtIO CdRom passthrough", - input: map[string]interface{}{"virtio10": "cdrom,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}, - }, - {name: "Disks VirtIO CdRom iso", - input: map[string]interface{}{"virtio9": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ - File: "debian-11.0.0-amd64-netinst.iso", - Storage: "local", - SizeInKibibytes: "377M", - }}}}}}, - }, - // Disks VirtIO CloudInit - {name: "Disks VirtIO CloudInit file", - input: map[string]interface{}{"virtio0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - {name: "Disks VirtIO CloudInit lvm", - input: map[string]interface{}{"virtio7": "Test:vm-100-cloudinit,media=cdrom"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{ - Format: QemuDiskFormat_Raw, - Storage: "Test", - }}}}}, - }, - // Disks VirtIO Disk - {name: "Disks VirtIO Disk", - input: map[string]interface{}{"virtio0": "test2:100/vm-100-disk-31.qcow2"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk ALL", - input: map[string]interface{}{"virtio1": "test2:100/vm-100-disk-31.qcow2,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=2,iops_wr=11,iops_wr_max=13,iops_wr_max_length=3,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,wwn=0x50015B3900F8EAD2"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 2, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 3, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - IOThread: true, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test2", - WorldWideName: "0x50015B3900F8EAD2", - }}}}}, - }, - {name: "Disks VirtIO Disk ALL LinkedClone", - input: map[string]interface{}{"virtio1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-31.qcow2,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=2,iops_wr=11,iops_wr_max=13,iops_wr_max_length=3,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,wwn=0x500FA2D000C69587"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 2, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 3, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_DirectSync, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - IOThread: true, - LinkedDiskId: &uint1, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 33554432, - Storage: "test2", - WorldWideName: "0x500FA2D000C69587", - }}}}}, - }, - {name: "Disks VirtIO Disk aio", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,aio=io_uring"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk backup", - input: map[string]interface{}{"virtio3": "test2:100/vm-100-disk-31.qcow2,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: false, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk cache", - input: map[string]interface{}{"virtio4": "test2:100/vm-100-disk-31.qcow2,cache=directsync"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Cache: QemuDiskCache_DirectSync, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk discard", - input: map[string]interface{}{"virtio5": "test2:100/vm-100-disk-31.qcow2,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Discard: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_rd", - input: map[string]interface{}{"virtio6": "test2:100/vm-100-disk-31.qcow2,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_rd_max", - input: map[string]interface{}{"virtio7": "test2:100/vm-100-disk-31.qcow2,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_rd_max_length", - input: map[string]interface{}{"virtio7": "test2:100/vm-100-disk-31.qcow2,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_wr", - input: map[string]interface{}{"virtio8": "test2:100/vm-100-disk-31.qcow2,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_wr_max", - input: map[string]interface{}{"virtio9": "test2:100/vm-100-disk-31.qcow2,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iops_wr_max_length", - input: map[string]interface{}{"virtio9": "test2:100/vm-100-disk-31.qcow2,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk iothread", - input: map[string]interface{}{"virtio10": "test2:100/vm-100-disk-31.qcow2,iothread=1"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - IOThread: true, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk mbps_rd", - input: map[string]interface{}{"virtio11": "test2:100/vm-100-disk-31.qcow2,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}, - }, - }, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk mbps_rd_max", - input: map[string]interface{}{"virtio12": "test2:100/vm-100-disk-31.qcow2,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk mbps_wr", - input: map[string]interface{}{"virtio13": "test2:100/vm-100-disk-31.qcow2,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk mbps_wr_max", - input: map[string]interface{}{"virtio14": "test2:100/vm-100-disk-31.qcow2,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk replicate", - input: map[string]interface{}{"virtio15": "test2:100/vm-100-disk-31.qcow2,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: false, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk ro", - input: map[string]interface{}{"virtio0": "test2:100/vm-100-disk-31.qcow2,ro=1"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - ReadOnly: true, - Replicate: true, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk serial", - input: map[string]interface{}{"virtio1": "test2:100/vm-100-disk-31.qcow2,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Serial: "disk-9763", - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk size G", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32G"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - SizeInKibibytes: 33554432, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk size K", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32K"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - SizeInKibibytes: 32, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk size M", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32M"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - SizeInKibibytes: 32768, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk size T", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=5T"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - SizeInKibibytes: 5368709120, - Storage: "test2", - }}}}}, - }, - {name: "Disks VirtIO Disk syntax fileSyntaxVolume", - input: map[string]interface{}{"virtio7": "test:vm-100-disk-2"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks VirtIO Disk syntax fileSyntaxVolume LinkedClone", - input: map[string]interface{}{"virtio8": "test:base-110-disk-1/vm-100-disk-2"}, - output: &ConfigQemu{ - LinkedVmId: 110, - Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Raw, - Id: uint2, - LinkedDiskId: &uint1, - Replicate: true, - Storage: "test", - syntax: diskSyntaxVolume, - }}}}}, - }, - {name: "Disks VirtIO Disk wwn", - input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,wwn=0x500D3FAB00B4E672"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Backup: true, - Format: QemuDiskFormat_Qcow2, - Id: uint31, - Replicate: true, - Storage: "test2", - WorldWideName: "0x500D3FAB00B4E672", - }}}}}, - }, - // Disks VirtIO Passthrough - {name: "Disks VirtIO Passthrough", - input: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough ALL", - input: map[string]interface{}{"virtio1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=native,backup=0,cache=unsafe,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=1G,wwn=0x500B6ED600F1C945"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: false, - Bandwidth: QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, - WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, - WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}, - }, - }, - Cache: QemuDiskCache_Unsafe, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - ReadOnly: true, - Replicate: false, - Serial: "disk-9763", - SizeInKibibytes: 1048576, - WorldWideName: "0x500B6ED600F1C945", - }}}}}, - }, - {name: "Disks VirtIO Passthrough aio", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=native"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough backup", - input: map[string]interface{}{"virtio3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: false, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough cache", - input: map[string]interface{}{"virtio4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=unsafe"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Cache: QemuDiskCache_Unsafe, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough discard", - input: map[string]interface{}{"virtio5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Discard: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_rd", - input: map[string]interface{}{"virtio6": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_rd_max", - input: map[string]interface{}{"virtio7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_rd_max_length", - input: map[string]interface{}{"virtio7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_wr", - input: map[string]interface{}{"virtio8": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_wr_max", - input: map[string]interface{}{"virtio9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iops_wr_max_length", - input: map[string]interface{}{"virtio9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough iothread", - input: map[string]interface{}{"virtio10": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iothread=1"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - IOThread: true, - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough mbps_rd", - input: map[string]interface{}{"virtio11": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough mbps_rd_max", - input: map[string]interface{}{"virtio12": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough mbps_wr", - input: map[string]interface{}{"virtio13": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough mbps_wr_max", - input: map[string]interface{}{"virtio14": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough replicate", - input: map[string]interface{}{"virtio15": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: false, - }}}}}, - }, - {name: "Disks VirtIO Passthrough ro", - input: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ro=1"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - ReadOnly: true, - Replicate: true, - }}}}}, - }, - {name: "Disks VirtIO Passthrough serial", - input: map[string]interface{}{"virtio1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - Serial: "disk-9763", - }}}}}, - }, - {name: "Disks VirtIO Passthrough size G", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1G"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1048576, - }}}}}, - }, - {name: "Disks VirtIO Passthrough size K", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1K"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1, - }}}}}, - }, - {name: "Disks VirtIO Passthrough size M", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1M"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1024, - }}}}}, - }, - {name: "Disks VirtIO Passthrough size T", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1T"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - SizeInKibibytes: 1073741824, - }}}}}, - }, - {name: "Disks VirtIO Passthrough wwn", - input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5008FA6500D9C8B3"}, - output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - Backup: true, - File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", - Replicate: true, - WorldWideName: "0x5008FA6500D9C8B3", - }}}}}, - }, - // Iso - {name: "Iso", - input: map[string]interface{}{"ide2": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, - output: &ConfigQemu{ - Iso: &IsoFile{ - File: "debian-11.0.0-amd64-netinst.iso", - Storage: "local", - SizeInKibibytes: "377M", - }, - Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{ - Iso: &IsoFile{ + {category: `Agent`, + tests: []test{ + {name: `ALL`, + input: map[string]interface{}{"agent": string("1,freeze-fs-on-backup=1,fstrim_cloned_disks=1,type=virtio")}, + output: &ConfigQemu{Agent: &QemuGuestAgent{ + Enable: util.Pointer(true), + Freeze: util.Pointer(true), + FsTrim: util.Pointer(true), + Type: util.Pointer(QemuGuestAgentType_VirtIO)}}}, + {name: `Enabled`, + input: map[string]interface{}{"agent": string("1")}, + output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true)}}}, + {name: `Freeze`, + input: map[string]interface{}{"agent": string("0,freeze-fs-on-backup=1")}, + output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(false), Freeze: util.Pointer(true)}}}, + {name: `FsTrim`, + input: map[string]interface{}{"agent": string("0,fstrim_cloned_disks=1")}, + output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(false), FsTrim: util.Pointer(true)}}}, + {name: `Type`, + input: map[string]interface{}{"agent": string("1,type=virtio")}, + output: &ConfigQemu{Agent: &QemuGuestAgent{Enable: util.Pointer(true), Type: util.Pointer(QemuGuestAgentType_VirtIO)}}}}}, + {category: `CloudInit`, + tests: []test{ + {name: `ALL`, + input: map[string]interface{}{ + "cicustom": string("meta=local-zfs:ci-meta.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"), + "searchdomain": string("example.com"), + "nameserver": string("1.1.1.1 8.8.8.8 9.9.9.9"), + "ipconfig0": string("ip=dhcp,ip6=dhcp"), + "ipconfig19": string(""), + "ipconfig31": string("ip=10.20.4.7/22"), + "sshkeys": test_data_qemu.PublicKey_Encoded_Input(), + "ciupgrade": float64(1), + "cipassword": string("Enter123!"), + "ciuser": string("root")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{ + FilePath: "ci-meta.yml", + Storage: "local-zfs"}, + Network: &CloudInitSnippet{ + FilePath: "ci-network.yml", + Storage: "local-lvm"}, + User: &CloudInitSnippet{ + FilePath: "ci-user.yml", + Storage: "folder"}, + Vendor: &CloudInitSnippet{ + FilePath: "snippets/ci-custom.yml", + Storage: "local"}}, + DNS: &GuestDNS{ + SearchDomain: util.Pointer("example.com"), + NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, + NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID31: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}, + PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Output()), + UpgradePackages: util.Pointer(true), + UserPassword: util.Pointer("Enter123!"), + Username: util.Pointer("root")}}}, + {name: `Custom Meta`, + input: map[string]interface{}{"cicustom": string("meta=local-zfs:ci-meta.yml")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{Meta: &CloudInitSnippet{FilePath: "ci-meta.yml", Storage: "local-zfs"}}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `Custom Network`, + input: map[string]interface{}{"cicustom": string("network=local-lvm:ci-network.yml")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{Network: &CloudInitSnippet{FilePath: "ci-network.yml", Storage: "local-lvm"}}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `Custom User`, + input: map[string]interface{}{ + "cicustom": string("user=folder:ci-user.yml")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{User: &CloudInitSnippet{FilePath: "ci-user.yml", Storage: "folder"}}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `Custom Vendor`, + input: map[string]interface{}{"cicustom": string("vendor=local:snippets/ci-custom.yml")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + Custom: &CloudInitCustom{Vendor: &CloudInitSnippet{FilePath: "snippets/ci-custom.yml", Storage: "local"}}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `DNS SearchDomain`, + input: map[string]interface{}{"searchdomain": string("example.com")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + DNS: &GuestDNS{ + SearchDomain: util.Pointer("example.com"), + NameServers: util.Pointer(uninitializedArray[netip.Addr]())}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `DNS SearchDomain empty`, + input: map[string]interface{}{"searchdomain": string(" ")}, + output: &ConfigQemu{}}, + {name: `DNS NameServers`, + input: map[string]interface{}{"nameserver": string("1.1.1.1 8.8.8.8 9.9.9.9")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + DNS: &GuestDNS{ + SearchDomain: util.Pointer(""), + NameServers: &[]netip.Addr{parseIP("1.1.1.1"), parseIP("8.8.8.8"), parseIP("9.9.9.9")}}, + NetworkInterfaces: CloudInitNetworkInterfaces{}}}}, + {name: `NetworkInterfaces`, + input: map[string]interface{}{ + "ipconfig0": string("ip=dhcp,ip6=dhcp"), + "ipconfig1": string("ip6=auto"), + "ipconfig2": string("ip=192.168.1.10/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48,gw6=2001:0db8:abcd::1"), + "ipconfig19": string(""), + "ipconfig20": string(" "), // this single space is on porpuse to test if it is ignored + "ipconfig31": string("ip=10.20.4.7/22")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{DHCP: true}, + IPv6: &CloudInitIPv6Config{DHCP: true}}, + QemuNetworkInterfaceID1: CloudInitNetworkConfig{ + IPv6: &CloudInitIPv6Config{SLAAC: true}}, + QemuNetworkInterfaceID2: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("192.168.1.10/24")), + Gateway: util.Pointer(IPv4Address("192.168.56.1"))}, + IPv6: &CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("2001:0db8:abcd::/48")), + Gateway: util.Pointer(IPv6Address("2001:0db8:abcd::1"))}}, + QemuNetworkInterfaceID31: CloudInitNetworkConfig{ + IPv4: &CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("10.20.4.7/22"))}}}}}}, + {name: `PublicSSHkeys`, + input: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Input()}, + output: &ConfigQemu{CloudInit: &CloudInit{ + NetworkInterfaces: CloudInitNetworkInterfaces{}, + PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Output())}}}, + {name: `UpgradePackages`, + input: map[string]interface{}{"ciupgrade": float64(0)}, + output: &ConfigQemu{CloudInit: &CloudInit{ + NetworkInterfaces: CloudInitNetworkInterfaces{}, + UpgradePackages: util.Pointer(false)}}}, + {name: `UserPassword`, + input: map[string]interface{}{"cipassword": string("Enter123!")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + NetworkInterfaces: CloudInitNetworkInterfaces{}, + UserPassword: util.Pointer("Enter123!")}}}, + {name: `Username`, + input: map[string]interface{}{"ciuser": string("root")}, + output: &ConfigQemu{CloudInit: &CloudInit{ + NetworkInterfaces: CloudInitNetworkInterfaces{}, + Username: util.Pointer("root")}}}, + {name: `Username empty`, + input: map[string]interface{}{"ciuser": string(" ")}, + output: &ConfigQemu{}}}}, + {category: `Disks Ide CdRom`, + tests: []test{ + {name: `none`, + input: map[string]interface{}{"ide1": "none,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{}}}}}}, + {name: `passthrough`, + input: map[string]interface{}{"ide2": "cdrom,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}}, + {name: `iso`, + input: map[string]interface{}{"ide3": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ File: "debian-11.0.0-amd64-netinst.iso", Storage: "local", - SizeInKibibytes: "377M", - }, - }}}}, - }, - }, - // EFI - {name: "EFI Disk", - input: map[string]interface{}{"efidisk0": "local-lvm:vm-1000-disk-0,efitype=2m,size=4M"}, - output: &ConfigQemu{EFIDisk: map[string]interface{}{ - "efitype": "2m", - "size": "4M", - "storage": "local-lvm", - "file": "vm-1000-disk-0", - "volume": "local-lvm:vm-1000-disk-0", - }}, - }, - // Node - {name: "Node vmr nil", - output: &ConfigQemu{}, - }, - {name: "Node vmr empty", - vmr: &VmRef{node: ""}, - output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}, - }, - {name: "Node vmr populated", - vmr: &VmRef{node: "test"}, - output: &ConfigQemu{Node: "test", Pool: util.Pointer(PoolName(""))}, - }, - // Pool - {name: "Pool vmr nil", - output: &ConfigQemu{}, - }, - {name: "Pool vmr empty", - vmr: &VmRef{pool: ""}, - output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}, - }, - {name: "Pool vmr populated", - vmr: &VmRef{pool: "test"}, - output: &ConfigQemu{Pool: util.Pointer(PoolName("test"))}, - }, - // VmID - {name: "VmID vmr nil", - output: &ConfigQemu{}, - }, - {name: "VmID vmr empty", - vmr: &VmRef{vmId: 0}, - output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}, - }, - {name: "VmID vmr populated", - vmr: &VmRef{vmId: 100}, - output: &ConfigQemu{VmID: 100, Pool: util.Pointer(PoolName(""))}, - }, - // TPM - {name: "TPM", - input: map[string]interface{}{"tpmstate0": string("local-lvm:vm-101-disk-0,size=4M,version=v2.0")}, - output: &ConfigQemu{TPM: &TpmState{Storage: "local-lvm", Version: util.Pointer(TpmVersion("v2.0"))}}, - }, - } + SizeInKibibytes: "377M"}}}}}}}}}, + {category: `Disks Ide CloudInit`, + tests: []test{ + {name: `file`, + input: map[string]interface{}{"ide0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}, + {name: `lvm`, + input: map[string]interface{}{"ide3": "Test:vm-100-cloudinit,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}}}, + {category: `Disks Ide Disk`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `ALL`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,aio=io_uring,backup=0,cache=writethrough,discard=on,iops_rd=12,iops_rd_max=13,iops_rd_max_length=4,iops_wr=15,iops_wr_max=14,iops_wr_max_length=5,mbps_rd=1.46,mbps_rd_max=3.57,mbps_wr=2.68,mbps_wr_max=4.55,replicate=0,serial=disk-9763,size=1032G,ssd=1,wwn=0x500F753600A987E1"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57, Concurrent: 1.46}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55, Concurrent: 2.68}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 12}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14, BurstDuration: 5, Concurrent: 15}}}, + Cache: QemuDiskCache_WriteThrough, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1082130432, + Storage: "test2", + WorldWideName: "0x500F753600A987E1"}}}}}}, + {name: `ALL LinkedClone`, + input: map[string]interface{}{"ide1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-53.qcow2,aio=io_uring,backup=0,cache=writethrough,discard=on,iops_rd=12,iops_rd_max=13,iops_rd_max_length=4,iops_wr=15,iops_wr_max=14,iops_wr_max_length=5,mbps_rd=1.46,mbps_rd_max=3.57,mbps_wr=2.68,mbps_wr_max=4.55,replicate=0,serial=disk-9763,size=1032G,ssd=1,wwn=0x500679CE00B1DAF4"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57, Concurrent: 1.46}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55, Concurrent: 2.68}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 12}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14, BurstDuration: 5, Concurrent: 15}}}, + Cache: QemuDiskCache_WriteThrough, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + LinkedDiskId: &uint1, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1082130432, + Storage: "test2", + WorldWideName: "0x500679CE00B1DAF4"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,aio=io_uring"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `backup`, + input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: false, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `cache`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,cache=writethrough"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Cache: QemuDiskCache_WriteThrough, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `discard`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,iops_rd=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 12}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,iops_rd_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,iops_wr=15"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 15}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,iops_wr_max=14"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 14}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,mbps_rd=1.46"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.46}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,mbps_rd_max=3.57"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.57}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,mbps_wr=2.68"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.68}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,mbps_wr_max=4.55"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.55}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"ide2": "test2:100/vm-100-disk-53.qcow2,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: false, + Storage: "test2"}}}}}}, + {name: `serial`, + input: map[string]interface{}{"ide3": "test2:100/vm-100-disk-53.qcow2,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Serial: "disk-9763", + Storage: "test2"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032G"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + SizeInKibibytes: 1082130432, + Storage: "test2"}}}}}}, + {name: `size K`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032K"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + SizeInKibibytes: 1032, + Storage: "test2"}}}}}}, + {name: `size M`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=1032M"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + SizeInKibibytes: 1056768, + Storage: "test2"}}}}}}, + {name: `size T`, + input: map[string]interface{}{"ide0": "test2:100/vm-100-disk-53.qcow2,size=2T"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + SizeInKibibytes: 2147483648, + Storage: "test2"}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `syntax fileSyntaxVolume`, + input: map[string]interface{}{"ide2": "test:vm-100-disk-2"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `syntax fileSyntaxVolume LinkedClone`, + input: map[string]interface{}{"ide3": "test:base-110-disk-1/vm-100-disk-2"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + LinkedDiskId: &uint1, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"ide1": "test2:100/vm-100-disk-53.qcow2,wwn=0x500DB82100C6FA59"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint53, + Replicate: true, + Storage: "test2", + WorldWideName: "0x500DB82100C6FA59"}}}}}}}}, + {category: `Disks Ide Passthrough`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `All`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,backup=0,cache=unsafe,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=1G,ssd=1,wwn=0x500CBE4300D978A6"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1048576, + WorldWideName: "0x500CBE4300D978A6"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `backup`, + input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: false, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `cache`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=unsafe"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Cache: QemuDiskCache_Unsafe, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `discard`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"ide2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false}}}}}}, + {name: `serial`, + input: map[string]interface{}{"ide3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "disk-9763"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10G"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 10485760}}}}}}, + {name: `size K`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10K"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 10}}}}}}, + {name: `size M`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10M"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 10240}}}}}}, + {name: `size T`, + input: map[string]interface{}{"ide0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=10T"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 10737418240}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"ide1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5005AC1200F643B8"}, + output: &ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + WorldWideName: "0x5005AC1200F643B8"}}}}}}}}, + {category: `Disks Sata CdRom`, + tests: []test{ + {name: `none`, + input: map[string]interface{}{"sata5": "none,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{CdRom: &QemuCdRom{}}}}}}, + {name: `passthrough`, + input: map[string]interface{}{"sata4": "cdrom,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}}, + {name: `iso`, + input: map[string]interface{}{"sata3": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ + File: "debian-11.0.0-amd64-netinst.iso", + Storage: "local", + SizeInKibibytes: "377M"}}}}}}}}}, + {category: `Disks Sata CloudInit`, + tests: []test{ + {name: `file`, + input: map[string]interface{}{"sata4": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}, + {name: `lvm`, + input: map[string]interface{}{"sata0": "Test:vm-100-cloudinit,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}}}, + {category: `Disks Sata Disk`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `ALL`, + input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,aio=native,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=32G,ssd=1,wwn=0x500DFA8900E3C641"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_None, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test2", + WorldWideName: "0x500DFA8900E3C641"}}}}}}, + {name: `ALL LinkedClone`, + input: map[string]interface{}{"sata1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-47.qcow2,aio=native,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=32G,ssd=1,wwn=0x5003B97600A8F2D4"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_None, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + LinkedDiskId: &uint1, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test2", + WorldWideName: "0x5003B97600A8F2D4"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,aio=native"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `backup`, + input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: false, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `cache`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,cache=none"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Cache: QemuDiskCache_None, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `discard`, + input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"sata0": "test2:100/vm-100-disk-47.qcow2,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"sata1": "test2:100/vm-100-disk-47.qcow2,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"sata2": "test2:100/vm-100-disk-47.qcow2,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: false, + Storage: "test2"}}}}}}, + {name: `serial`, + input: map[string]interface{}{"sata3": "test2:100/vm-100-disk-47.qcow2,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Serial: "disk-9763", + Storage: "test2"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32G"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + SizeInKibibytes: 33554432, + Storage: "test2"}}}}}}, + {name: `size K`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32K"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + SizeInKibibytes: 32, + Storage: "test2"}}}}}}, + {name: `size M`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=32M"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + SizeInKibibytes: 32768, + Storage: "test2"}}}}}}, + {name: `size T`, + input: map[string]interface{}{"sata4": "test2:100/vm-100-disk-47.qcow2,size=3T"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + SizeInKibibytes: 3221225472, + Storage: "test2"}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `syntax fileSyntaxVolume`, + input: map[string]interface{}{"sata0": "test:vm-100-disk-2"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `syntax fileSyntaxVolume LinkedClone`, + input: map[string]interface{}{"sata1": "test:base-110-disk-1/vm-100-disk-2"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + LinkedDiskId: &uint1, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"sata5": "test2:100/vm-100-disk-47.qcow2,wwn=0x5001E48A00D567C9"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint47, + Replicate: true, + Storage: "test2", + WorldWideName: "0x5001E48A00D567C9"}}}}}}}}, + {category: `Disks Sata Passthrough`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `All`, + input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=5,iops_wr=11,iops_wr_max=13,iops_wr_max_length=4,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,serial=disk-9763,size=1G,ssd=1,wwn=500E9FBC00F2A6D3"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 5, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 4, Concurrent: 11}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1048576, + WorldWideName: "500E9FBC00F2A6D3"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=io_uring"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `backup`, + input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: false, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `cache`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=directsync"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Cache: QemuDiskCache_DirectSync, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `discard`, + input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"sata0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"sata1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"sata2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false}}}}}}, + {name: `serial`, + input: map[string]interface{}{"sata3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "disk-9763"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=3G"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 3145728}}}}}}, + {name: `size K`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=5789K"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 5789}}}}}}, + {name: `size M`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=45M"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 46080}}}}}}, + {name: `size T`, + input: map[string]interface{}{"sata4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=7T"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 7516192768}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"sata5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5004D2EF00C8B57A"}, + output: &ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + WorldWideName: "0x5004D2EF00C8B57A"}}}}}}}}, + {category: `Disks Scsi CdRom`, + tests: []test{ + {name: `none`, + input: map[string]interface{}{"scsi30": "none,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_30: &QemuScsiStorage{CdRom: &QemuCdRom{}}}}}}, + {name: `passthrough`, + input: map[string]interface{}{"scsi29": "cdrom,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_29: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}}, + {name: `iso`, + input: map[string]interface{}{"scsi28": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_28: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ + File: "debian-11.0.0-amd64-netinst.iso", + Storage: "local", + SizeInKibibytes: "377M"}}}}}}}}}, + {category: `Disks Scsi CloudInit`, + tests: []test{ + {name: `file`, + input: map[string]interface{}{"scsi0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}, + {name: `lvm`, + input: map[string]interface{}{"scsi23": "Test:vm-100-cloudinit,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_23: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}}}, + {category: `Disks Scsi Disk`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"scsi0": "test:100/vm-100-disk-2.qcow2"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `ALL`, + input: map[string]interface{}{"scsi1": "test:100/vm-100-disk-2.qcow2,aio=threads,backup=0,cache=writeback,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,ssd=1,wwn=0x500AF18700E9CD25"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_WriteBack, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + IOThread: true, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test", + WorldWideName: "0x500AF18700E9CD25"}}}}}}, + {name: `ALL LinkedClone`, + input: map[string]interface{}{"scsi1": "test:110/base-110-disk-1.qcow2/100/vm-100-disk-2.qcow2,aio=threads,backup=0,cache=writeback,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,ssd=1,wwn=0x500879DC00F3BE6A"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_WriteBack, + Discard: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + IOThread: true, + LinkedDiskId: &uint1, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test", + WorldWideName: "0x500879DC00F3BE6A"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"scsi2": "test:100/vm-100-disk-2.qcow2,aio=threads"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `backup`, + input: map[string]interface{}{"scsi3": "test:100/vm-100-disk-2.qcow2,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: false, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `cache`, + input: map[string]interface{}{"scsi4": "test:100/vm-100-disk-2.qcow2,cache=writeback"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Cache: QemuDiskCache_WriteBack, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `discard`, + input: map[string]interface{}{"scsi5": "test:100/vm-100-disk-2.qcow2,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"scsi6": "test:100/vm-100-disk-2.qcow2,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"scsi7": "test:100/vm-100-disk-2.qcow2,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"scsi7": "test:100/vm-100-disk-2.qcow2,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"scsi8": "test:100/vm-100-disk-2.qcow2,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"scsi9": "test:100/vm-100-disk-2.qcow2,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"scsi9": "test:100/vm-100-disk-2.qcow2,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `iothread`, + input: map[string]interface{}{"scsi10": "test:100/vm-100-disk-2.qcow2,iothread=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + IOThread: true, + Replicate: true, + Storage: "test"}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"scsi11": "test:100/vm-100-disk-2.qcow2,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"scsi12": "test:100/vm-100-disk-2.qcow2,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"scsi13": "test:100/vm-100-disk-2.qcow2,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"scsi14": "test:100/vm-100-disk-2.qcow2,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"scsi15": "test:100/vm-100-disk-2.qcow2,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: false, + Storage: "test"}}}}}}, + {name: `ro`, + input: map[string]interface{}{"scsi16": "test:100/vm-100-disk-2.qcow2,ro=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + ReadOnly: true, + Replicate: true, + Storage: "test"}}}}}}, + {name: `serial`, + input: map[string]interface{}{"scsi17": "test:100/vm-100-disk-2.qcow2,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Serial: "disk-9763", + Storage: "test"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32G"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + SizeInKibibytes: 33554432, + Storage: "test"}}}}}}, + {name: `size K`, + input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32K"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + SizeInKibibytes: 32, + Storage: "test"}}}}}}, + {name: `size M`, + input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=32M"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + SizeInKibibytes: 32768, + Storage: "test"}}}}}}, + {name: `size T`, + input: map[string]interface{}{"scsi18": "test:100/vm-100-disk-2.qcow2,size=4T"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + SizeInKibibytes: 4294967296, + Storage: "test"}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"scsi19": "test:100/vm-100-disk-2.qcow2,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + EmulateSSD: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test"}}}}}}, + {name: `syntax fileSyntaxVolume`, + input: map[string]interface{}{"scsi6": "test:vm-100-disk-2"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `syntax fileSyntaxVolume LinkedClone`, + input: map[string]interface{}{"scsi7": "test:base-110-disk-1/vm-100-disk-2"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + LinkedDiskId: &uint1, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"scsi19": "test:100/vm-100-disk-2.qcow2,wwn=0x500E265400A1F3D7"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint2, + Replicate: true, + Storage: "test", + WorldWideName: "0x500E265400A1F3D7"}}}}}}}}, + {category: `Disks Scsi Passthrough`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"scsi0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `All`, + input: map[string]interface{}{"scsi1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads,backup=0,cache=none,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=1G,ssd=1,wwn=500CB15600D8FE32"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_None, + Discard: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1048576, + WorldWideName: "500CB15600D8FE32"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"scsi2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=threads"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `backup`, + input: map[string]interface{}{"scsi3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: false, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `cache`, + input: map[string]interface{}{"scsi4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=none"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Cache: QemuDiskCache_None, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `discard`, + input: map[string]interface{}{"scsi5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"scsi6": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"scsi7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"scsi7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"scsi8": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"scsi9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"scsi9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iothread`, + input: map[string]interface{}{"scsi10": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iothread=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + Replicate: true}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"scsi11": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"scsi12": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"scsi13": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"scsi14": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"scsi15": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false}}}}}}, + {name: `ro`, + input: map[string]interface{}{"scsi16": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ro=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + ReadOnly: true, + Replicate: true}}}}}}, + {name: `serial`, + input: map[string]interface{}{"scsi17": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_17: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "disk-9763"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1G"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1048576}}}}}}, + {name: `size K`, + input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1K"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1}}}}}}, + {name: `size M`, + input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1M"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1024}}}}}}, + {name: `size T`, + input: map[string]interface{}{"scsi18": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1T"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_18: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1073741824}}}}}}, + {name: `ssd`, + input: map[string]interface{}{"scsi19": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ssd=1"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + EmulateSSD: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"scsi19": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5009A4FC00B7C613"}, + output: &ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_19: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + WorldWideName: "0x5009A4FC00B7C613"}}}}}}}}, + {category: `Disks VirtIO CdRom`, + tests: []test{ + {name: `none`, + input: map[string]interface{}{"virtio11": "none,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{CdRom: &QemuCdRom{}}}}}}, + {name: `passthrough`, + input: map[string]interface{}{"virtio10": "cdrom,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{CdRom: &QemuCdRom{Passthrough: true}}}}}}, + {name: `iso`, + input: map[string]interface{}{"virtio9": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{ + File: "debian-11.0.0-amd64-netinst.iso", + Storage: "local", + SizeInKibibytes: "377M"}}}}}}}}}, + {category: `Disks VirtIO CloudInit`, + tests: []test{ + {name: `file`, + input: map[string]interface{}{"virtio0": "Test:100/vm-100-cloudinit.raw,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}, + {name: `lvm`, + input: map[string]interface{}{"virtio7": "Test:vm-100-cloudinit,media=cdrom"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{ + Format: QemuDiskFormat_Raw, + Storage: "Test"}}}}}}}}, + {category: `Disks VirtIO Disk`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"virtio0": "test2:100/vm-100-disk-31.qcow2"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `ALL`, + input: map[string]interface{}{"virtio1": "test2:100/vm-100-disk-31.qcow2,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=2,iops_wr=11,iops_wr_max=13,iops_wr_max_length=3,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,wwn=0x50015B3900F8EAD2"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 2, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 3, Concurrent: 11}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + IOThread: true, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test2", + WorldWideName: "0x50015B3900F8EAD2"}}}}}}, + {name: `ALL LinkedClone`, + input: map[string]interface{}{"virtio1": "test2:110/base-110-disk-1.qcow2/100/vm-100-disk-31.qcow2,aio=io_uring,backup=0,cache=directsync,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=2,iops_wr=11,iops_wr_max=13,iops_wr_max_length=3,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=32G,wwn=0x500FA2D000C69587"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 2, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 3, Concurrent: 11}}}, + Cache: QemuDiskCache_DirectSync, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + IOThread: true, + LinkedDiskId: &uint1, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 33554432, + Storage: "test2", + WorldWideName: "0x500FA2D000C69587"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,aio=io_uring"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `backup`, + input: map[string]interface{}{"virtio3": "test2:100/vm-100-disk-31.qcow2,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: false, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `cache`, + input: map[string]interface{}{"virtio4": "test2:100/vm-100-disk-31.qcow2,cache=directsync"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Cache: QemuDiskCache_DirectSync, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `discard`, + input: map[string]interface{}{"virtio5": "test2:100/vm-100-disk-31.qcow2,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Discard: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"virtio6": "test2:100/vm-100-disk-31.qcow2,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"virtio7": "test2:100/vm-100-disk-31.qcow2,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"virtio7": "test2:100/vm-100-disk-31.qcow2,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"virtio8": "test2:100/vm-100-disk-31.qcow2,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"virtio9": "test2:100/vm-100-disk-31.qcow2,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"virtio9": "test2:100/vm-100-disk-31.qcow2,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `iothread`, + input: map[string]interface{}{"virtio10": "test2:100/vm-100-disk-31.qcow2,iothread=1"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + IOThread: true, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"virtio11": "test2:100/vm-100-disk-31.qcow2,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"virtio12": "test2:100/vm-100-disk-31.qcow2,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"virtio13": "test2:100/vm-100-disk-31.qcow2,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"virtio14": "test2:100/vm-100-disk-31.qcow2,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"virtio15": "test2:100/vm-100-disk-31.qcow2,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: false, + Storage: "test2"}}}}}}, + {name: `ro`, + input: map[string]interface{}{"virtio0": "test2:100/vm-100-disk-31.qcow2,ro=1"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + ReadOnly: true, + Replicate: true, + Storage: "test2"}}}}}}, + {name: `serial`, + input: map[string]interface{}{"virtio1": "test2:100/vm-100-disk-31.qcow2,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Serial: "disk-9763", + Storage: "test2"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32G"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + SizeInKibibytes: 33554432, + Storage: "test2"}}}}}}, + {name: `size K`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32K"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + SizeInKibibytes: 32, + Storage: "test2"}}}}}}, + {name: `size M`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=32M"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + SizeInKibibytes: 32768, + Storage: "test2"}}}}}}, + {name: `size T`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,size=5T"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + SizeInKibibytes: 5368709120, + Storage: "test2"}}}}}}, + {name: `syntax fileSyntaxVolume`, + input: map[string]interface{}{"virtio7": "test:vm-100-disk-2"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `syntax fileSyntaxVolume LinkedClone`, + input: map[string]interface{}{"virtio8": "test:base-110-disk-1/vm-100-disk-2"}, + output: &ConfigQemu{ + LinkedVmId: 110, + Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Raw, + Id: uint2, + LinkedDiskId: &uint1, + Replicate: true, + Storage: "test", + syntax: diskSyntaxVolume}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"virtio2": "test2:100/vm-100-disk-31.qcow2,wwn=0x500D3FAB00B4E672"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Backup: true, + Format: QemuDiskFormat_Qcow2, + Id: uint31, + Replicate: true, + Storage: "test2", + WorldWideName: "0x500D3FAB00B4E672"}}}}}}}}, + {category: `Disks VirtIO Passthrough`, + tests: []test{ + {name: ``, + input: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `ALL`, + input: map[string]interface{}{"virtio1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=native,backup=0,cache=unsafe,discard=on,iops_rd=10,iops_rd_max=12,iops_rd_max_length=4,iops_wr=11,iops_wr_max=13,iops_wr_max_length=5,iothread=1,mbps_rd=1.51,mbps_rd_max=3.51,mbps_wr=2.51,mbps_wr_max=4.51,replicate=0,ro=1,serial=disk-9763,size=1G,wwn=0x500B6ED600F1C945"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: false, + Bandwidth: QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51, Concurrent: 1.51}, + WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51, Concurrent: 2.51}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12, BurstDuration: 4, Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13, BurstDuration: 5, Concurrent: 11}}}, + Cache: QemuDiskCache_Unsafe, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + ReadOnly: true, + Replicate: false, + Serial: "disk-9763", + SizeInKibibytes: 1048576, + WorldWideName: "0x500B6ED600F1C945"}}}}}}, + {name: `aio`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,aio=native"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `backup`, + input: map[string]interface{}{"virtio3": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,backup=0"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: false, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `cache`, + input: map[string]interface{}{"virtio4": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,cache=unsafe"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Cache: QemuDiskCache_Unsafe, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `discard`, + input: map[string]interface{}{"virtio5": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,discard=on"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Discard: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd`, + input: map[string]interface{}{"virtio6": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd=10"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 10}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max`, + input: map[string]interface{}{"virtio7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max=12"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 12}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_rd_max_length`, + input: map[string]interface{}{"virtio7": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_rd_max_length=2"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 2}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr`, + input: map[string]interface{}{"virtio8": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr=11"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 11}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max`, + input: map[string]interface{}{"virtio9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max=13"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 13}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iops_wr_max_length`, + input: map[string]interface{}{"virtio9": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iops_wr_max_length=3"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{BurstDuration: 3}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `iothread`, + input: map[string]interface{}{"virtio10": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,iothread=1"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + IOThread: true, + Replicate: true}}}}}}, + {name: `mbps_rd`, + input: map[string]interface{}{"virtio11": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd=1.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 1.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_rd_max`, + input: map[string]interface{}{"virtio12": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_rd_max=3.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 3.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr`, + input: map[string]interface{}{"virtio13": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr=2.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 2.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `mbps_wr_max`, + input: map[string]interface{}{"virtio14": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,mbps_wr_max=4.51"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 4.51}}}, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true}}}}}}, + {name: `replicate`, + input: map[string]interface{}{"virtio15": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,replicate=0"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: false}}}}}}, + {name: `ro`, + input: map[string]interface{}{"virtio0": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,ro=1"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + ReadOnly: true, + Replicate: true}}}}}}, + {name: `serial`, + input: map[string]interface{}{"virtio1": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,serial=disk-9763"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + Serial: "disk-9763"}}}}}}, + {name: `size G`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1G"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1048576}}}}}}, + {name: `size K`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1K"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1}}}}}}, + {name: `size M`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1M"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1024}}}}}}, + {name: `size T`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,size=1T"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + SizeInKibibytes: 1073741824}}}}}}, + {name: `wwn`, + input: map[string]interface{}{"virtio2": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8,wwn=0x5008FA6500D9C8B3"}, + output: &ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + Backup: true, + File: "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi8", + Replicate: true, + WorldWideName: "0x5008FA6500D9C8B3"}}}}}}}}, + {category: `Iso`, + tests: []test{ + {name: `All`, + input: map[string]interface{}{"ide2": "local:iso/debian-11.0.0-amd64-netinst.iso,media=cdrom,size=377M"}, + output: &ConfigQemu{ + Iso: &IsoFile{ + File: "debian-11.0.0-amd64-netinst.iso", + Storage: "local", + SizeInKibibytes: "377M"}, + Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{ + Iso: &IsoFile{ + File: "debian-11.0.0-amd64-netinst.iso", + Storage: "local", + SizeInKibibytes: "377M"}}}}}}}}}, + {category: `EFI Disk`, + tests: []test{ + {name: `All`, + input: map[string]interface{}{"efidisk0": "local-lvm:vm-1000-disk-0,efitype=2m,size=4M"}, + output: &ConfigQemu{EFIDisk: map[string]interface{}{ + "efitype": "2m", + "size": "4M", + "storage": "local-lvm", + "file": "vm-1000-disk-0", + "volume": "local-lvm:vm-1000-disk-0"}}}}}, + {category: `Node`, + tests: []test{ + {name: `vmr nil`, + output: &ConfigQemu{}}, + {name: `vmr empty`, + vmr: &VmRef{node: ""}, + output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}}, + {name: `vmr populated`, + vmr: &VmRef{node: "test"}, + output: &ConfigQemu{Node: "test", Pool: util.Pointer(PoolName(""))}}}}, + {category: `Pool`, + tests: []test{ + {name: `vmr nil`, + output: &ConfigQemu{}}, + {name: `vmr empty`, + vmr: &VmRef{pool: ""}, + output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}}, + {name: `vmr populated`, + vmr: &VmRef{pool: "test"}, + output: &ConfigQemu{Pool: util.Pointer(PoolName("test"))}}}}, + {category: `VmID`, + tests: []test{ + {name: `vmr nil`, + output: &ConfigQemu{}}, + {name: `vmr empty`, + vmr: &VmRef{vmId: 0}, + output: &ConfigQemu{Pool: util.Pointer(PoolName(""))}}, + {name: `vmr populated`, + vmr: &VmRef{vmId: 100}, + output: &ConfigQemu{VmID: 100, Pool: util.Pointer(PoolName(""))}}}}, + {category: `TPM`, + tests: []test{ + {name: `All`, + input: map[string]interface{}{"tpmstate0": string("local-lvm:vm-101-disk-0,size=4M,version=v2.0")}, + output: &ConfigQemu{TPM: &TpmState{Storage: "local-lvm", Version: util.Pointer(TpmVersion("v2.0"))}}}}}} for _, test := range tests { - t.Run(test.name, func(*testing.T) { - output, err := ConfigQemu{}.mapToStruct(test.vmr, test.input) - if err != nil { - require.Equal(t, test.err, err, test.name) - } else { - require.Equal(t, test.output, output, test.name) + for _, subTest := range test.tests { + name := test.category + if len(test.tests) > 1 { + name += "/" + subTest.name } - }) + t.Run(name, func(*testing.T) { + output, err := ConfigQemu{}.mapToStruct(subTest.vmr, subTest.input) + if err != nil { + require.Equal(t, subTest.err, err, name) + } else { + require.Equal(t, subTest.output, output, name) + } + }) + } } } From c6dce2d72134b3c3ebc0edbbb8c0b3a02996f488 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Fri, 21 Jun 2024 00:28:13 +0200 Subject: [PATCH 3/6] refactor: make test easier to navigate --- proxmox/config_qemu_test.go | 2608 +++++++++++++++-------------------- 1 file changed, 1147 insertions(+), 1461 deletions(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index ecaf4e16..3a65405c 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -5436,93 +5436,73 @@ func Test_ConfigQemu_mapToStruct(t *testing.T) { } func Test_ConfigQemu_Validate(t *testing.T) { - BandwidthValid0 := QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 0, - Concurrent: 0, - }, - WriteLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 0, - Concurrent: 0, - }, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{ - Burst: 0, - Concurrent: 0, - }, - WriteLimit: QemuDiskBandwidthIopsLimit{ - Burst: 0, - Concurrent: 0, - }, - }, + BandwidthValid0 := func() QemuDiskBandwidth { + return QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 0, + Concurrent: 0}, + WriteLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 0, + Concurrent: 0}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{ + Burst: 0, + Concurrent: 0}, + WriteLimit: QemuDiskBandwidthIopsLimit{ + Burst: 0, + Concurrent: 0}}} } - BandwidthValid1 := QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 1, - Concurrent: 1, - }, - WriteLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 1, - Concurrent: 1, - }, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{ - Burst: 10, - Concurrent: 10, - }, - WriteLimit: QemuDiskBandwidthIopsLimit{ - Burst: 10, - Concurrent: 10, - }, - }, + BandwidthValid1 := func() QemuDiskBandwidth { + return QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 1, + Concurrent: 1}, + WriteLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 1, + Concurrent: 1}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{ + Burst: 10, + Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{ + Burst: 10, + Concurrent: 10}}} } - BandwidthValid2 := QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 1, - Concurrent: 0, - }, - WriteLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 1, - Concurrent: 0, - }, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{ - Burst: 10, - Concurrent: 0, - }, - WriteLimit: QemuDiskBandwidthIopsLimit{ - Burst: 10, - Concurrent: 0, - }, - }, + BandwidthValid2 := func() QemuDiskBandwidth { + return QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 1, + Concurrent: 0}, + WriteLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 1, + Concurrent: 0}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{ + Burst: 10, + Concurrent: 0}, + WriteLimit: QemuDiskBandwidthIopsLimit{ + Burst: 10, + Concurrent: 0}}} } - BandwidthValid3 := QemuDiskBandwidth{ - MBps: QemuDiskBandwidthMBps{ - ReadLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 0, - Concurrent: 1, - }, - WriteLimit: QemuDiskBandwidthMBpsLimit{ - Burst: 0, - Concurrent: 1, - }, - }, - Iops: QemuDiskBandwidthIops{ - ReadLimit: QemuDiskBandwidthIopsLimit{ - Burst: 0, - Concurrent: 10, - }, - WriteLimit: QemuDiskBandwidthIopsLimit{ - Burst: 0, - Concurrent: 10, - }, - }, + BandwidthValid3 := func() QemuDiskBandwidth { + return QemuDiskBandwidth{ + MBps: QemuDiskBandwidthMBps{ + ReadLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 0, + Concurrent: 1}, + WriteLimit: QemuDiskBandwidthMBpsLimit{ + Burst: 0, + Concurrent: 1}}, + Iops: QemuDiskBandwidthIops{ + ReadLimit: QemuDiskBandwidthIopsLimit{ + Burst: 0, + Concurrent: 10}, + WriteLimit: QemuDiskBandwidthIopsLimit{ + Burst: 0, + Concurrent: 10}}} } validCloudInit := QemuCloudInitDisk{Format: QemuDiskFormat_Raw, Storage: "Test"} validTags := func() []Tag { @@ -5533,1394 +5513,1100 @@ func Test_ConfigQemu_Validate(t *testing.T) { } return tags } - testData := []struct { + type test struct { name string input ConfigQemu current *ConfigQemu err error + } + tests := []struct { + category string + valid []test + invalid []test }{ - // Valid - // Valid Agent - {name: "Valid Agent", - input: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType("isa"))}}}, - // Valid CloudInit - {name: `Valid CloudInit`, - input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ - Meta: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Legal())}, - Network: &CloudInitSnippet{FilePath: ""}, - User: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Legal())}, - Vendor: &CloudInitSnippet{FilePath: ""}}, - NetworkInterfaces: CloudInitNetworkInterfaces{ - QemuNetworkInterfaceID0: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.45.1/24"))})}, - QemuNetworkInterfaceID1: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))})}, - QemuNetworkInterfaceID2: CloudInitNetworkConfig{ + {category: `Agent`, + valid: []test{ + {input: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType("isa"))}}}}, + invalid: []test{ + {input: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType("test"))}}, + err: errors.New(QemuGuestAgentType_Error_Invalid)}}}, + {category: `CloudInit`, + valid: []test{ + {input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ + Meta: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Legal())}, + Network: &CloudInitSnippet{FilePath: ""}, + User: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Legal())}, + Vendor: &CloudInitSnippet{FilePath: ""}}, + NetworkInterfaces: CloudInitNetworkInterfaces{ + QemuNetworkInterfaceID0: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.45.1/24"))})}, + QemuNetworkInterfaceID1: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR(""))})}, + QemuNetworkInterfaceID2: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{ + Address: util.Pointer(IPv4CIDR("")), + DHCP: true})}, + QemuNetworkInterfaceID3: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{ + Gateway: util.Pointer(IPv4Address("")), + DHCP: true})}, + QemuNetworkInterfaceID4: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.45.1"))})}, + QemuNetworkInterfaceID5: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))})}, + QemuNetworkInterfaceID9: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64"))})}, + QemuNetworkInterfaceID10: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))})}, + QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + DHCP: true})}, + QemuNetworkInterfaceID12: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{ + Gateway: util.Pointer(IPv6Address("")), + DHCP: true})}, + QemuNetworkInterfaceID13: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc"))})}, + QemuNetworkInterfaceID14: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))})}, + QemuNetworkInterfaceID15: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{ + Address: util.Pointer(IPv6CIDR("")), + SLAAC: true})}, + QemuNetworkInterfaceID16: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{ + Gateway: util.Pointer(IPv6Address("")), + SLAAC: true})}}}}}}, + invalid: []test{ + {name: `errors.New(CloudInitSnippetPath_Error_InvalidCharacters)`, + input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Meta: &CloudInitSnippet{ + FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Character_Illegal()[0])}}}}, + err: errors.New(CloudInitSnippetPath_Error_InvalidCharacters)}, + {name: `errors.New(CloudInitSnippetPath_Error_InvalidPath)`, + input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Network: &CloudInitSnippet{ + FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_InvalidPath())}}}}, + err: errors.New(CloudInitSnippetPath_Error_InvalidPath)}, + {name: `errors.New(CloudInitSnippetPath_Error_MaxLength)`, + input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{User: &CloudInitSnippet{ + FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Illegal())}}}}, + err: errors.New(CloudInitSnippetPath_Error_MaxLength)}, + {name: `errors.New(CloudInitSnippetPath_Error_Relative)`, + input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Vendor: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Relative())}}}}, + err: errors.New(CloudInitSnippetPath_Error_Relative)}, + {name: `errors.New(QemuNetworkInterfaceID_Error_Invalid)`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ + 32: CloudInitNetworkConfig{}}}}, + err: errors.New(QemuNetworkInterfaceID_Error_Invalid)}, + {name: `CloudInitNetworkInterfaces IPv4 Address Mutually exclusive with DHCP`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID5: CloudInitNetworkConfig{ IPv4: util.Pointer(CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("")), - DHCP: true})}, - QemuNetworkInterfaceID3: CloudInitNetworkConfig{ + Address: util.Pointer(IPv4CIDR("192.168.45.1/24")), + DHCP: true})}}}}, + err: errors.New(CloudInitIPv4Config_Error_DhcpAddressMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv4 Gateway Mutually exclusive with DHCP`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID6: CloudInitNetworkConfig{ IPv4: util.Pointer(CloudInitIPv4Config{ - Gateway: util.Pointer(IPv4Address("")), - DHCP: true})}, - QemuNetworkInterfaceID4: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.45.1"))})}, - QemuNetworkInterfaceID5: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address(""))})}, - QemuNetworkInterfaceID9: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64"))})}, - QemuNetworkInterfaceID10: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR(""))})}, - QemuNetworkInterfaceID11: CloudInitNetworkConfig{ + Gateway: util.Pointer(IPv4Address("192.168.45.1")), + DHCP: true})}}}}, + err: errors.New(CloudInitIPv4Config_Error_DhcpGatewayMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv4 Address errors.New(IPv4CIDR_Error_Invalid)`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID7: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.45.1"))})}}}}, + err: errors.New(IPv4CIDR_Error_Invalid)}, + {name: `CloudInitNetworkInterfaces IPv4 Gateway errors.New(IPv4Address_Error_Invalid)`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID8: CloudInitNetworkConfig{ + IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.45.1/24"))})}}}}, + err: errors.New(IPv4Address_Error_Invalid)}, + {name: `CloudInitNetworkInterfaces IPv6 Address Mutually exclusive with DHCP`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID17: CloudInitNetworkConfig{ IPv6: util.Pointer(CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - DHCP: true})}, - QemuNetworkInterfaceID12: CloudInitNetworkConfig{ + Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64")), + DHCP: true})}}}}, + err: errors.New(CloudInitIPv6Config_Error_DhcpAddressMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv6 Address Mutually exclusive with SLAAC`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID18: CloudInitNetworkConfig{ IPv6: util.Pointer(CloudInitIPv6Config{ - Gateway: util.Pointer(IPv6Address("")), - DHCP: true})}, - QemuNetworkInterfaceID13: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc"))})}, - QemuNetworkInterfaceID14: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address(""))})}, - QemuNetworkInterfaceID15: CloudInitNetworkConfig{ + Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64")), + SLAAC: true})}}}}, + err: errors.New(CloudInitIPv6Config_Error_SlaacAddressMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv6 DHCP Mutually exclusive with SLAAC`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID19: CloudInitNetworkConfig{ IPv6: util.Pointer(CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("")), - SLAAC: true})}, - QemuNetworkInterfaceID16: CloudInitNetworkConfig{ + DHCP: true, + SLAAC: true})}}}}, + err: errors.New(CloudInitIPv6Config_Error_DhcpSlaacMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv6 Gateway Mutually exclusive with DHCP`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID20: CloudInitNetworkConfig{ IPv6: util.Pointer(CloudInitIPv6Config{ - Gateway: util.Pointer(IPv6Address("")), - SLAAC: true})}}}}}, - // Valid Disks - {name: "Valid Disks Empty 0", - input: ConfigQemu{Disks: &QemuStorages{}}, - }, - {name: "Valid Disks Empty 1", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}, - Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}, - Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}, - VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}, - }}, - }, - // Valid Disks CdRom - {name: "Valid Disks CdRom", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}, - Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}}}}, - Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}, - VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}}}}, - }}, - }, - // Valid Disks CloudInit - {name: "Valid Disks CloudInit Ide", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}}}}, - }, - {name: "Valid Disks CloudInit Sata", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}}}}, - }, - {name: "Valid Disks CloudInit Scsi", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}}}}, - }, - {name: "Valid Disks CloudInit VirtIO", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}}}}, - }, - // Valid Disks Disk - {name: "Valid Disks Disk", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Bandwidth: BandwidthValid0, - Cache: QemuDiskCache_DirectSync, - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 5748543, - Storage: "test", - WorldWideName: "0x500A1B2C3D4E5F60", - }}}, - Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - AsyncIO: QemuDiskAsyncIO_Native, - Bandwidth: BandwidthValid1, - Cache: QemuDiskCache_None, - Format: QemuDiskFormat_Cow, - SizeInKibibytes: 4097, - Storage: "test", - WorldWideName: "0x500F123456789ABC", - }}}, - Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ - AsyncIO: QemuDiskAsyncIO_Threads, - Bandwidth: BandwidthValid2, - Cache: QemuDiskCache_WriteBack, - Format: QemuDiskFormat_Qcow2, - SizeInKibibytes: 9475478, - Storage: "test", - WorldWideName: "0x5009876543210DEF", - }}}, - VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - AsyncIO: "", - Bandwidth: BandwidthValid3, - Cache: "", - Format: QemuDiskFormat_Vmdk, - SizeInKibibytes: 18742, - Storage: "test", - WorldWideName: "0x500C0D0E0F101112", - }}}, - }}, - }, - // Valid Disks Passthrough - {name: "Valid Disks Passthrough", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ - AsyncIO: QemuDiskAsyncIO_IOuring, - Bandwidth: BandwidthValid3, - Cache: QemuDiskCache_DirectSync, - File: "test", - WorldWideName: "0x5001A2B3C4D5E6F7", - }}}, - Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ - AsyncIO: QemuDiskAsyncIO_Native, - Bandwidth: BandwidthValid2, - Cache: "", - File: "test", - WorldWideName: "0x500B0A0908070605", - }}}, - Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ - AsyncIO: QemuDiskAsyncIO_Threads, - Bandwidth: BandwidthValid1, - Cache: QemuDiskCache_WriteBack, - File: "test", - WorldWideName: "0x500F1E2D3C4B5A69", - }}}, - VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ - AsyncIO: "", - Bandwidth: BandwidthValid0, - Cache: QemuDiskCache_WriteThrough, - File: "test", - WorldWideName: "0x5004A3B2C1D0E0F1", - }}}, - }}, - }, - // Valid Pool - {name: "Valid PoolName", - input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Legal()))}}, - {name: "Valid PoolName Empty", - input: ConfigQemu{Pool: util.Pointer(PoolName(""))}}, - // Valid Tags - {name: "Valid Tags", - input: ConfigQemu{Tags: util.Pointer(validTags())}, - }, - // Valid Tpm - {name: "Valid TPM Create", - input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v2.0"))}}}, - {name: "Valid TPM Update", - input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v2.0"))}}, - current: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v1.2"))}}}, - {name: "Valid TPM Update Version=nil", - input: ConfigQemu{TPM: &TpmState{Storage: "test"}}, - current: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v1.2"))}}}, - // Invalid - // Invalid Agent - {name: "Invalid Agent", - input: ConfigQemu{Agent: &QemuGuestAgent{Type: util.Pointer(QemuGuestAgentType("test"))}}, - err: errors.New(QemuGuestAgentType_Error_Invalid)}, - // Invalid CloudInit - {name: `Invalid CloudInit errors.New(CloudInitSnippetPath_Error_InvalidCharacters)`, - input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Meta: &CloudInitSnippet{ - FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Character_Illegal()[0])}}}}, - err: errors.New(CloudInitSnippetPath_Error_InvalidCharacters)}, - {name: `Invalid CloudInit errors.New(CloudInitSnippetPath_Error_InvalidPath)`, - input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Network: &CloudInitSnippet{ - FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_InvalidPath())}}}}, - err: errors.New(CloudInitSnippetPath_Error_InvalidPath)}, - {name: `Invalid CloudInit errors.New(CloudInitSnippetPath_Error_MaxLength)`, - input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{User: &CloudInitSnippet{ - FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Max_Illegal())}}}}, - err: errors.New(CloudInitSnippetPath_Error_MaxLength)}, - {name: `Invalid CloudInit errors.New(CloudInitSnippetPath_Error_Relative)`, - input: ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{Vendor: &CloudInitSnippet{FilePath: CloudInitSnippetPath(test_data_qemu.CloudInitSnippetPath_Relative())}}}}, - err: errors.New(CloudInitSnippetPath_Error_Relative)}, - {name: `Invalid CloudInit errors.New(QemuNetworkInterfaceID_Error_Invalid)`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{ - 32: CloudInitNetworkConfig{}}}}, - err: errors.New(QemuNetworkInterfaceID_Error_Invalid)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv4 Address Mutually exclusive with DHCP`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID5: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{ - Address: util.Pointer(IPv4CIDR("192.168.45.1/24")), - DHCP: true})}}}}, - err: errors.New(CloudInitIPv4Config_Error_DhcpAddressMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv4 Gateway Mutually exclusive with DHCP`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID6: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{ - Gateway: util.Pointer(IPv4Address("192.168.45.1")), - DHCP: true})}}}}, - err: errors.New(CloudInitIPv4Config_Error_DhcpGatewayMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv4 Address errors.New(IPv4CIDR_Error_Invalid)`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID7: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Address: util.Pointer(IPv4CIDR("192.168.45.1"))})}}}}, - err: errors.New(IPv4CIDR_Error_Invalid)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv4 Gateway errors.New(IPv4Address_Error_Invalid)`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID8: CloudInitNetworkConfig{ - IPv4: util.Pointer(CloudInitIPv4Config{Gateway: util.Pointer(IPv4Address("192.168.45.1/24"))})}}}}, - err: errors.New(IPv4Address_Error_Invalid)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Address Mutually exclusive with DHCP`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID17: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64")), - DHCP: true})}}}}, - err: errors.New(CloudInitIPv6Config_Error_DhcpAddressMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Address Mutually exclusive with SLAAC`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID18: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{ - Address: util.Pointer(IPv6CIDR("2001:0db8:85a3::/64")), - SLAAC: true})}}}}, - err: errors.New(CloudInitIPv6Config_Error_SlaacAddressMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 DHCP Mutually exclusive with SLAAC`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID19: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{ - DHCP: true, - SLAAC: true})}}}}, - err: errors.New(CloudInitIPv6Config_Error_DhcpSlaacMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Gateway Mutually exclusive with DHCP`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID20: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{ - Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc")), - DHCP: true})}}}}, - err: errors.New(CloudInitIPv6Config_Error_DhcpGatewayMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Gateway Mutually exclusive with SLAAC`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID21: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{ - Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc")), - SLAAC: true})}}}}, - err: errors.New(CloudInitIPv6Config_Error_SlaacGatewayMutuallyExclusive)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Address errors.New(IPv6CIDR_Error_Invalid)`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID22: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc"))})}}}}, - err: errors.New(IPv6CIDR_Error_Invalid)}, - {name: `Invalid CloudInit CloudInitNetworkInterfaces IPv6 Gateway errors.New(IPv6Address_Error_Invalid)`, - input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID23: CloudInitNetworkConfig{ - IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::/64"))})}}}}, - err: errors.New(IPv6Address_Error_Invalid)}, - // Invalid Disks Mutually exclusive Ide - {name: "Invalid Disks MutuallyExclusive Ide 0", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 1", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuIdeDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 2", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 3", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuIdeDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 4", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 5", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ - Disk: &QemuIdeDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 6", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuIdeDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 7", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuIdeDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 8", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuIdeDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 9", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Ide 10", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuIdeDisk{}, - Passthrough: &QemuIdePassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - // Invalid Disks Mutually exclusive Sata - {name: "Invalid Disks MutuallyExclusive Sata 0", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 1", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuSataDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 2", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 3", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuSataDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 4", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{ - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 5", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{ - Disk: &QemuSataDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 6", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuSataDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 7", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuSataDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 8", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuSataDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 9", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Sata 10", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuSataDisk{}, - Passthrough: &QemuSataPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - // Invalid Disks Mutually exclusive Scsi - {name: "Invalid Disks MutuallyExclusive Scsi 0", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 1", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuScsiDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 2", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 3", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuScsiDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 4", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{ - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 5", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{ - Disk: &QemuScsiDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 6", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuScsiDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 7", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuScsiDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 8", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuScsiDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 9", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive Scsi 10", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuScsiDisk{}, - Passthrough: &QemuScsiPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - // Invalid Disks Mutually exclusive VirtIO - {name: "Invalid Disks MutuallyExclusive VirtIO 0", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 1", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuVirtIODisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 2", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 3", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuVirtIODisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 4", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{ - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 5", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{ - Disk: &QemuVirtIODisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 6", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuVirtIODisk{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 7", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{ - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuVirtIODisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 8", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - Disk: &QemuVirtIODisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 9", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - {name: "Invalid Disks MutuallyExclusive VirtIO 10", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{ - CdRom: &QemuCdRom{}, - CloudInit: &QemuCloudInitDisk{}, - Disk: &QemuVirtIODisk{}, - Passthrough: &QemuVirtIOPassthrough{}, - }}}}, - err: errors.New(Error_QemuDisk_MutuallyExclusive), - }, - // Invalid Disks CdRom Ide - {name: "Invalid Disks CdRom Ide errors.New(Error_IsoFile_File) 0", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Ide errors.New(Error_IsoFile_File) 1", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Ide errors.New(Error_IsoFile_Storage)", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, - err: errors.New(Error_IsoFile_Storage), - }, - {name: "Invalid Disks CdRom Ide errors.New(Error_QemuCdRom_MutuallyExclusive)", - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, - err: errors.New(Error_QemuCdRom_MutuallyExclusive), - }, - // Invalid Disks CdRom Sata - {name: "Invalid Disks CdRom Sata errors.New(Error_IsoFile_File) 0", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Sata errors.New(Error_IsoFile_File) 1", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Sata errors.New(Error_IsoFile_Storage)", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, - err: errors.New(Error_IsoFile_Storage), - }, - {name: "Invalid Disks CdRom Sata errors.New(Error_QemuCdRom_MutuallyExclusive)", - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, - err: errors.New(Error_QemuCdRom_MutuallyExclusive), - }, - // Invalid Disks CdRom Scsi - {name: "Invalid Disks CdRom Scsi errors.New(Error_IsoFile_File) 0", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Scsi errors.New(Error_IsoFile_File) 1", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom Scsi errors.New(Error_IsoFile_Storage)", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, - err: errors.New(Error_IsoFile_Storage), - }, - {name: "Invalid Disks CdRom Scsi errors.New(Error_QemuCdRom_MutuallyExclusive)", - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, - err: errors.New(Error_QemuCdRom_MutuallyExclusive), - }, - // Invalid Disks CdRom VirtIO - {name: "Invalid Disks CdRom VirtIO errors.New(Error_IsoFile_File) 0", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom VirtIO errors.New(Error_IsoFile_File) 1", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, - err: errors.New(Error_IsoFile_File), - }, - {name: "Invalid Disks CdRom VirtIO errors.New(Error_IsoFile_Storage)", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, - err: errors.New(Error_IsoFile_Storage), - }, - {name: "Invalid Disks CdRom VirtIO errors.New(Error_QemuCdRom_MutuallyExclusive)", - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, - err: errors.New(Error_QemuCdRom_MutuallyExclusive), - }, - // Invalid Disks CloudInit Duplicate - {name: "Invalid Disks CloudInit Duplicate errors.New(Error_QemuCloudInitDisk_OnlyOne)", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}}, - Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}}, - Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}}, - VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}}, - }}, - err: errors.New(Error_QemuCloudInitDisk_OnlyOne), - }, - {name: "Invalid Disks CloudInit Duplicate Ide errors.New(Error_QemuCloudInitDisk_OnlyOne)", - input: ConfigQemu{Disks: &QemuStorages{ - Ide: &QemuIdeDisks{ - Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}, - Disk_1: &QemuIdeStorage{CloudInit: &validCloudInit}, - }, - }}, - err: errors.New(Error_QemuCloudInitDisk_OnlyOne), - }, - {name: "Invalid Disks CloudInit Duplicate Sata errors.New(Error_QemuCloudInitDisk_OnlyOne)", - input: ConfigQemu{Disks: &QemuStorages{ - Sata: &QemuSataDisks{ - Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}, - Disk_1: &QemuSataStorage{CloudInit: &validCloudInit}, - }, - }}, - err: errors.New(Error_QemuCloudInitDisk_OnlyOne), - }, - {name: "Invalid Disks CloudInit Duplicate Scsi errors.New(Error_QemuCloudInitDisk_OnlyOne)", - input: ConfigQemu{Disks: &QemuStorages{ - Scsi: &QemuScsiDisks{ - Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}, - Disk_1: &QemuScsiStorage{CloudInit: &validCloudInit}, - }, - }}, - err: errors.New(Error_QemuCloudInitDisk_OnlyOne), - }, - {name: "Invalid Disks CloudInit Duplicate VirtIO errors.New(Error_QemuCloudInitDisk_OnlyOne)", - input: ConfigQemu{Disks: &QemuStorages{ - VirtIO: &QemuVirtIODisks{ - Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}, - Disk_1: &QemuVirtIOStorage{CloudInit: &validCloudInit}, - }, - }}, - err: errors.New(Error_QemuCloudInitDisk_OnlyOne), - }, - // Invalid Disks CloudInit Ide - {name: `Invalid Disks CloudInit Ide QemuDiskFormat("").Error() 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Ide QemuDiskFormat("").Error() 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Ide errors.New(Error_QemuCloudInitDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, - err: errors.New(Error_QemuCloudInitDisk_Storage), - }, - // Invalid Disks CloudInit Sata - {name: `Invalid Disks CloudInit Sata QemuDiskFormat("").Error() 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Sata QemuDiskFormat("").Error() 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Sata errors.New(Error_QemuCloudInitDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, - err: errors.New(Error_QemuCloudInitDisk_Storage), - }, - // Invalid Disks CloudInit Scsi - {name: `Invalid Disks CloudInit Scsi QemuDiskFormat("").Error() 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Scsi QemuDiskFormat("").Error() 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit Scsi errors.New(Error_QemuCloudInitDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, - err: errors.New(Error_QemuCloudInitDisk_Storage), - }, - // Invalid Disks CloudInit VirtIO - {name: `Invalid Disks CloudInit VirtIO QemuDiskFormat("").Error() 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit VirtIO QemuDiskFormat("").Error() 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks CloudInit VirtIO errors.New(Error_QemuCloudInitDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, - err: errors.New(Error_QemuCloudInitDisk_Storage), - }, - // Invalid Disks Disk Ide - {name: `Invalid Disks Disk Ide QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Ide QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Ide QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Disk Ide QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Format: ""}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Serial: "!@^$^&$^&"}, - }}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal()), - }}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Disk Ide errors.New(QemuDiskSize_Error_Minimum)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 4096, - }}}}}, - err: errors.New(QemuDiskSize_Error_Minimum), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: qemuDiskSize_Minimum, - Storage: "", - }}}}}, - err: errors.New(Error_QemuDisk_Storage), - }, - {name: `Invalid Disks Disk Ide errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 32, - Storage: "Test", - WorldWideName: "0xG123456789ABCDE", - }}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Disk Sata - {name: `Invalid Disks Disk Sata QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Sata QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Sata QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Disk Sata QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Format: ""}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Serial: "!@^$^&$^&"}, - }}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal()), - }}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Disk Sata errors.New(QemuDiskSize_Error_Minimum)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 4096, - }}}}}, - err: errors.New(QemuDiskSize_Error_Minimum), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: qemuDiskSize_Minimum, - Storage: "", - }}}}}, - err: errors.New(Error_QemuDisk_Storage), - }, - {name: `Invalid Disks Disk Sata errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 32, - Storage: "Test", - WorldWideName: "500A1B2C3D4E5F60", - }}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Disk Scsi - {name: `Invalid Disks Disk Scsi QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Scsi QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk Scsi QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Disk Scsi QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{Format: ""}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Serial: "!@^$^&$^&"}, - }}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal()), - }}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Disk Scsi errors.New(QemuDiskSize_Error_Minimum)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 0, - }}}}}, - err: errors.New(QemuDiskSize_Error_Minimum), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: qemuDiskSize_Minimum, - Storage: "", - }}}}}, - err: errors.New(Error_QemuDisk_Storage), - }, - {name: `Invalid Disks Disk Scsi errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 32, - Storage: "Test", - WorldWideName: "0x5009876543210DEFG", - }}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Disk VirtIO - {name: `Invalid Disks Disk VirtIO QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk VirtIO QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Disk VirtIO QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Disk VirtIO QemuDiskFormat("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: ""}}}}}, - err: QemuDiskFormat("").Error(), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Serial: "!@^$^&$^&"}, - }}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal()), - }}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Disk VirtIO errors.New(QemuDiskSize_Error_Minimum)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 1024, - }}}}}, - err: errors.New(QemuDiskSize_Error_Minimum), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuDisk_Storage)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: qemuDiskSize_Minimum, - Storage: "", - }}}}}, - err: errors.New(Error_QemuDisk_Storage), - }, - {name: `Invalid Disks Disk VirtIO errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ - Format: QemuDiskFormat_Raw, - SizeInKibibytes: 32, - Storage: "Test", - WorldWideName: "500C0D0E0F10111", - }}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Passthrough Ide - {name: `Invalid Disks Passthrough Ide QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Ide QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDisk_File)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: ""}}}}}, - err: errors.New(Error_QemuDisk_File), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Passthrough Ide errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "5001A2B3C4D5E6F7"}}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Passthrough Sata - {name: `Invalid Disks Passthrough Sata QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Sata QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDisk_File)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: ""}}}}}, - err: errors.New(Error_QemuDisk_File), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Passthrough Sata errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "0x500B0A09080706050"}}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Passthrough Scsi - {name: `Invalid Disks Passthrough Scsi QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough Scsi QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDisk_File)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: ""}}}}}, - err: errors.New(Error_QemuDisk_File), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Passthrough Scsi errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "500F1E2D3C4B5A69!"}}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Disks Passthrough VirtIO - {name: `Invalid Disks Passthrough VirtIO QemuDiskAsyncIO("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{AsyncIO: "invalid"}}}}}, - err: QemuDiskAsyncIO("").Error(), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, - err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent), - }, - {name: `Invalid Disks Passthrough VirtIO QemuDiskCache("").Error()`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Cache: "invalid"}}}}}, - err: QemuDiskCache("").Error(), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDisk_File)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: ""}}}}}, - err: errors.New(Error_QemuDisk_File), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskSerial_IllegalCharacter)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalCharacter), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuDiskSerial_IllegalLength)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, - err: errors.New(Error_QemuDiskSerial_IllegalLength), - }, - {name: `Invalid Disks Passthrough VirtIO errors.New(Error_QemuWorldWideName_Invalid)`, - input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "0x5004A3B2C1D0E0F1#"}}}}}, - err: errors.New(Error_QemuWorldWideName_Invalid), - }, - // Invalid Pool - {name: "Invalid Pool Length", - input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Max_Illegal()))}, - err: errors.New(PoolName_Error_Length)}, - {name: "Invalid Pool Characters", - input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Error_Characters()[0]))}, - err: errors.New(PoolName_Error_Characters)}, - // Invalid Tags - {name: `Invalid Tags errors.New(Tag_Error_Invalid)`, - input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Illegal())})}, - err: errors.New(Tag_Error_Invalid)}, - {name: `Invalid Tags errors.New(Tag_Error_Duplicate)`, - input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Max_Legal()), Tag(test_data_tag.Tag_Max_Legal())})}, - err: errors.New(Tag_Error_Duplicate)}, - {name: `Invalid Tags errors.New(Tag_Error_Empty)`, - input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Empty())})}, - err: errors.New(Tag_Error_Empty)}, - {name: `Invalid Tags errors.New(Tag_Error_MaxLength)`, - input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Max_Illegal())})}, - err: errors.New(Tag_Error_MaxLength)}, - // invalid TMP - {name: "Invalid TPM errors.New(storage is required) Create", - input: ConfigQemu{TPM: &TpmState{Storage: ""}}, - err: errors.New("storage is required")}, - {name: "Invalid TPM errors.New(storage is required) Update", - input: ConfigQemu{TPM: &TpmState{Storage: ""}}, - current: &ConfigQemu{TPM: &TpmState{}}, - err: errors.New("storage is required")}, - {name: "Invalid TPM errors.New(TmpState_Error_VersionRequired) Create", - input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: nil}}, - err: errors.New(TmpState_Error_VersionRequired)}, - {name: "Invalid TPM errors.New(TmpVersion_Error_Invalid) Create", - input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion(""))}}, - err: errors.New(TpmVersion_Error_Invalid)}, - {name: "Invalid TPM errors.New(TmpVersion_Error_Invalid) Update", - input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion(""))}}, - current: &ConfigQemu{TPM: &TpmState{}}, - err: errors.New(TpmVersion_Error_Invalid)}, - } - for _, test := range testData { - if test.current == nil { - t.Run(test.name, func(*testing.T) { - require.Equal(t, test.input.Validate(test.current), test.err, test.name) + Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc")), + DHCP: true})}}}}, + err: errors.New(CloudInitIPv6Config_Error_DhcpGatewayMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv6 Gateway Mutually exclusive with SLAAC`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID21: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{ + Gateway: util.Pointer(IPv6Address("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc")), + SLAAC: true})}}}}, + err: errors.New(CloudInitIPv6Config_Error_SlaacGatewayMutuallyExclusive)}, + {name: `CloudInitNetworkInterfaces IPv6 Address errors.New(IPv6CIDR_Error_Invalid)`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID22: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Address: util.Pointer(IPv6CIDR("3f6d:5b2a:1e4d:7c91:abcd:1234:5678:9abc"))})}}}}, + err: errors.New(IPv6CIDR_Error_Invalid)}, + {name: `CloudInitNetworkInterfaces IPv6 Gateway errors.New(IPv6Address_Error_Invalid)`, + input: ConfigQemu{CloudInit: &CloudInit{NetworkInterfaces: CloudInitNetworkInterfaces{QemuNetworkInterfaceID23: CloudInitNetworkConfig{ + IPv6: util.Pointer(CloudInitIPv6Config{Gateway: util.Pointer(IPv6Address("2001:0db8:85a3::/64"))})}}}}, + err: errors.New(IPv6Address_Error_Invalid)}}}, + {category: `Disks`, + valid: []test{ + {name: `Empty 0`, + input: ConfigQemu{Disks: &QemuStorages{}}}, + {name: `Empty 1`, + input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{}}, + Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{}}, + Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{}}, + VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{}}}}}}, + invalid: []test{ + {name: `MutuallyExclusive Ide 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuIdeDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 2`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 3`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuIdeDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 4`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 5`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ + Disk: &QemuIdeDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 6`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuIdeDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 7`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuIdeDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 8`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuIdeDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 9`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Ide 10`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuIdeDisk{}, + Passthrough: &QemuIdePassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuSataDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 2`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 3`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuSataDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 4`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{ + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 5`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{ + Disk: &QemuSataDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 6`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuSataDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 7`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuSataDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 8`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuSataDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 9`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Sata 10`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuSataDisk{}, + Passthrough: &QemuSataPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuScsiDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 2`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 3`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuScsiDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 4`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{ + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 5`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{ + Disk: &QemuScsiDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 6`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuScsiDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 7`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuScsiDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 8`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuScsiDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 9`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive Scsi 10`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuScsiDisk{}, + Passthrough: &QemuScsiPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuVirtIODisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 2`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 3`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuVirtIODisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 4`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{ + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 5`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{ + Disk: &QemuVirtIODisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 6`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuVirtIODisk{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 7`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{ + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuVirtIODisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 8`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + Disk: &QemuVirtIODisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 9`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}, + {name: `MutuallyExclusive VirtIO 10`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{ + CdRom: &QemuCdRom{}, + CloudInit: &QemuCloudInitDisk{}, + Disk: &QemuVirtIODisk{}, + Passthrough: &QemuVirtIOPassthrough{}}}}}, + err: errors.New(Error_QemuDisk_MutuallyExclusive)}}}, + {category: `Disks CdRom`, + valid: []test{ + {input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{}}}, + Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}}}}, + Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{Passthrough: true}}}, + VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}}}}}}}}, + invalid: []test{ + {name: `Ide errors.New(Error_IsoFile_File) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Ide errors.New(Error_IsoFile_File) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Ide errors.New(Error_IsoFile_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, + err: errors.New(Error_IsoFile_Storage)}, + {name: `Ide errors.New(Error_QemuCdRom_MutuallyExclusive)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, + err: errors.New(Error_QemuCdRom_MutuallyExclusive)}, + {name: `Sata errors.New(Error_IsoFile_File) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Sata errors.New(Error_IsoFile_File) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Sata errors.New(Error_IsoFile_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, + err: errors.New(Error_IsoFile_Storage)}, + {name: `Sata errors.New(Error_QemuCdRom_MutuallyExclusive)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, + err: errors.New(Error_QemuCdRom_MutuallyExclusive)}, + {name: `Scsi errors.New(Error_IsoFile_File) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Scsi errors.New(Error_IsoFile_File) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `Scsi errors.New(Error_IsoFile_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, + err: errors.New(Error_IsoFile_Storage)}, + {name: `Scsi errors.New(Error_QemuCdRom_MutuallyExclusive)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, + err: errors.New(Error_QemuCdRom_MutuallyExclusive)}, + {name: `VirtIO errors.New(Error_IsoFile_File) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `VirtIO errors.New(Error_IsoFile_File) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{Storage: "test"}}}}}}, + err: errors.New(Error_IsoFile_File)}, + {name: `VirtIO errors.New(Error_IsoFile_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test"}}}}}}, + err: errors.New(Error_IsoFile_Storage)}, + {name: `VirtIO errors.New(Error_QemuCdRom_MutuallyExclusive)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{CdRom: &QemuCdRom{Iso: &IsoFile{File: "test", Storage: "test"}, Passthrough: true}}}}}, + err: errors.New(Error_QemuCdRom_MutuallyExclusive)}}}, + {category: `Disks CloudInit`, + valid: []test{ + {name: `Ide`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}}}}}, + {name: `Sata`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}}}}}, + {name: `Scsi`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}}}}}, + {name: `VirtIO`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}}}}}}, + invalid: []test{ + {name: `Duplicate errors.New(Error_QemuCloudInitDisk_OnlyOne)`, + input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}}, + Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}}, + Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}}, + VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}}}}, + err: errors.New(Error_QemuCloudInitDisk_OnlyOne)}, + {name: `Duplicate Ide errors.New(Error_QemuCloudInitDisk_OnlyOne)`, + input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{ + Disk_0: &QemuIdeStorage{CloudInit: &validCloudInit}, + Disk_1: &QemuIdeStorage{CloudInit: &validCloudInit}}}}, + err: errors.New(Error_QemuCloudInitDisk_OnlyOne)}, + {name: `Duplicate Sata errors.New(Error_QemuCloudInitDisk_OnlyOne)`, + input: ConfigQemu{Disks: &QemuStorages{ + Sata: &QemuSataDisks{ + Disk_0: &QemuSataStorage{CloudInit: &validCloudInit}, + Disk_1: &QemuSataStorage{CloudInit: &validCloudInit}}}}, + err: errors.New(Error_QemuCloudInitDisk_OnlyOne)}, + {name: `Duplicate Scsi errors.New(Error_QemuCloudInitDisk_OnlyOne)`, + input: ConfigQemu{Disks: &QemuStorages{ + Scsi: &QemuScsiDisks{ + Disk_0: &QemuScsiStorage{CloudInit: &validCloudInit}, + Disk_1: &QemuScsiStorage{CloudInit: &validCloudInit}}}}, + err: errors.New(Error_QemuCloudInitDisk_OnlyOne)}, + {name: `Duplicate VirtIO errors.New(Error_QemuCloudInitDisk_OnlyOne)`, + input: ConfigQemu{Disks: &QemuStorages{ + VirtIO: &QemuVirtIODisks{ + Disk_0: &QemuVirtIOStorage{CloudInit: &validCloudInit}, + Disk_1: &QemuVirtIOStorage{CloudInit: &validCloudInit}}}}, + err: errors.New(Error_QemuCloudInitDisk_OnlyOne)}, + {name: `Ide QemuDiskFormat("").Error() 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Ide QemuDiskFormat("").Error() 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Ide errors.New(Error_QemuCloudInitDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, + err: errors.New(Error_QemuCloudInitDisk_Storage)}, + {name: `Sata QemuDiskFormat("").Error() 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Sata QemuDiskFormat("").Error() 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Sata errors.New(Error_QemuCloudInitDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, + err: errors.New(Error_QemuCloudInitDisk_Storage)}, + {name: `Scsi QemuDiskFormat("").Error() 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Scsi QemuDiskFormat("").Error() 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Scsi errors.New(Error_QemuCloudInitDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, + err: errors.New(Error_QemuCloudInitDisk_Storage)}, + {name: `VirtIO QemuDiskFormat("").Error() 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `VirtIO QemuDiskFormat("").Error() 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Storage: "test"}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `VirtIO errors.New(Error_QemuCloudInitDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{CloudInit: &QemuCloudInitDisk{Format: QemuDiskFormat_Raw}}}}}, + err: errors.New(Error_QemuCloudInitDisk_Storage)}}}, + {category: `Disks Disk`, + valid: []test{ + {input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Bandwidth: BandwidthValid0(), + Cache: QemuDiskCache_DirectSync, + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 5748543, + Storage: "test", + WorldWideName: "0x500A1B2C3D4E5F60"}}}, + Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + AsyncIO: QemuDiskAsyncIO_Native, + Bandwidth: BandwidthValid1(), + Cache: QemuDiskCache_None, + Format: QemuDiskFormat_Cow, + SizeInKibibytes: 4097, + Storage: "test", + WorldWideName: "0x500F123456789ABC"}}}, + Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{ + AsyncIO: QemuDiskAsyncIO_Threads, + Bandwidth: BandwidthValid2(), + Cache: QemuDiskCache_WriteBack, + Format: QemuDiskFormat_Qcow2, + SizeInKibibytes: 9475478, + Storage: "test", + WorldWideName: "0x5009876543210DEF"}}}, + VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + AsyncIO: "", + Bandwidth: BandwidthValid3(), + Cache: "", + Format: QemuDiskFormat_Vmdk, + SizeInKibibytes: 18742, + Storage: "test", + WorldWideName: "0x500C0D0E0F101112"}}}}}}}, + invalid: []test{ + {name: `Ide QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Ide QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Ide QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Ide QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{Format: ""}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Ide errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Ide errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Ide errors.New(QemuDiskSize_Error_Minimum)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 4096}}}}}, + err: errors.New(QemuDiskSize_Error_Minimum)}, + {name: `Ide errors.New(Error_QemuDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: qemuDiskSize_Minimum, + Storage: ""}}}}}, + err: errors.New(Error_QemuDisk_Storage)}, + {name: `Ide errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Disk: &QemuIdeDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 32, + Storage: "Test", + WorldWideName: "0xG123456789ABCDE"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `Sata QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Sata QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Sata QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Disk: &QemuSataDisk{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Sata QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Disk: &QemuSataDisk{Format: ""}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Sata errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Sata errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Sata errors.New(QemuDiskSize_Error_Minimum)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 4096}}}}}, + err: errors.New(QemuDiskSize_Error_Minimum)}, + {name: `Sata errors.New(Error_QemuDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: qemuDiskSize_Minimum, + Storage: ""}}}}}, + err: errors.New(Error_QemuDisk_Storage)}, + {name: `Sata errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Disk: &QemuSataDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 32, + Storage: "Test", + WorldWideName: "500A1B2C3D4E5F60"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `Scsi QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Disk: &QemuScsiDisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Scsi QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Disk: &QemuScsiDisk{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Disk: &QemuScsiDisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Scsi QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Disk: &QemuScsiDisk{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Scsi QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Disk: &QemuScsiDisk{Format: ""}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `Scsi errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Scsi errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Scsi errors.New(QemuDiskSize_Error_Minimum)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_14: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 0}}}}}, + err: errors.New(QemuDiskSize_Error_Minimum)}, + {name: `Scsi errors.New(Error_QemuDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_15: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: qemuDiskSize_Minimum, + Storage: ""}}}}}, + err: errors.New(Error_QemuDisk_Storage)}, + {name: `Scsi errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_16: &QemuScsiStorage{Disk: &QemuScsiDisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 32, + Storage: "Test", + WorldWideName: "0x5009876543210DEFG"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `VirtIO QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `VirtIO QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `VirtIO QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `VirtIO QemuDiskFormat("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{Format: ""}}}}}, + err: QemuDiskFormat("").Error()}, + {name: `VirtIO errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `VirtIO errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `VirtIO errors.New(QemuDiskSize_Error_Minimum)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_14: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 1024}}}}}, + err: errors.New(QemuDiskSize_Error_Minimum)}, + {name: `VirtIO errors.New(Error_QemuDisk_Storage)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_15: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: qemuDiskSize_Minimum, + Storage: ""}}}}}, + err: errors.New(Error_QemuDisk_Storage)}, + {name: `VirtIO errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Disk: &QemuVirtIODisk{ + Format: QemuDiskFormat_Raw, + SizeInKibibytes: 32, + Storage: "Test", + WorldWideName: "500C0D0E0F10111"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}}}, + {category: `Disks Passthrough`, + valid: []test{ + {input: ConfigQemu{Disks: &QemuStorages{ + Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{ + AsyncIO: QemuDiskAsyncIO_IOuring, + Bandwidth: BandwidthValid3(), + Cache: QemuDiskCache_DirectSync, + File: "test", + WorldWideName: "0x5001A2B3C4D5E6F7"}}}, + Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{ + AsyncIO: QemuDiskAsyncIO_Native, + Bandwidth: BandwidthValid2(), + Cache: "", + File: "test", + WorldWideName: "0x500B0A0908070605"}}}, + Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{ + AsyncIO: QemuDiskAsyncIO_Threads, + Bandwidth: BandwidthValid1(), + Cache: QemuDiskCache_WriteBack, + File: "test", + WorldWideName: "0x500F1E2D3C4B5A69"}}}, + VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{ + AsyncIO: "", + Bandwidth: BandwidthValid0(), + Cache: QemuDiskCache_WriteThrough, + File: "test", + WorldWideName: "0x5004A3B2C1D0E0F1"}}}}}}}, + invalid: []test{ + {name: `Ide QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Ide errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Ide QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Ide errors.New(Error_QemuDisk_File)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_2: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: ""}}}}}, + err: errors.New(Error_QemuDisk_File)}, + {name: `Ide errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_3: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Ide errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_0: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Ide errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Ide: &QemuIdeDisks{Disk_1: &QemuIdeStorage{Passthrough: &QemuIdePassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "5001A2B3C4D5E6F7"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `Sata QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_2: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Sata errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Sata QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_3: &QemuSataStorage{Passthrough: &QemuSataPassthrough{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Sata errors.New(Error_QemuDisk_File)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_4: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: ""}}}}}, + err: errors.New(Error_QemuDisk_File)}, + {name: `Sata errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_5: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Sata errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_0: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Sata errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Sata: &QemuSataDisks{Disk_1: &QemuSataStorage{Passthrough: &QemuSataPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "0x500B0A09080706050"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `Scsi QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_0: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_5: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_6: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_7: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_8: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_1: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_2: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_3: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `Scsi errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_4: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `Scsi QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_9: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `Scsi errors.New(Error_QemuDisk_File)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_10: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: ""}}}}}, + err: errors.New(Error_QemuDisk_File)}, + {name: `Scsi errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_11: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `Scsi errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_12: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `Scsi errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{Scsi: &QemuScsiDisks{Disk_13: &QemuScsiStorage{Passthrough: &QemuScsiPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "500F1E2D3C4B5A69!"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}, + {name: `VirtIO QemuDiskAsyncIO("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_0: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{AsyncIO: "invalid"}}}}}, + err: QemuDiskAsyncIO("").Error()}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_5: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Burst: 9}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_6: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{ReadLimit: QemuDiskBandwidthIopsLimit{Concurrent: 8}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_7: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Burst: 7}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_8: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{Iops: QemuDiskBandwidthIops{WriteLimit: QemuDiskBandwidthIopsLimit{Concurrent: 6}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthIopsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_1: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 0`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_2: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{ReadLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitBurst) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_3: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Burst: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitBurst)}, + {name: `VirtIO errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent) 1`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_4: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Bandwidth: QemuDiskBandwidth{MBps: QemuDiskBandwidthMBps{WriteLimit: QemuDiskBandwidthMBpsLimit{Concurrent: 0.99}}}}}}}}, + err: errors.New(Error_QemuDiskBandwidthMBpsLimitConcurrent)}, + {name: `VirtIO QemuDiskCache("").Error()`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_9: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{Cache: "invalid"}}}}}, + err: QemuDiskCache("").Error()}, + {name: `VirtIO errors.New(Error_QemuDisk_File)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_10: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: ""}}}}}, + err: errors.New(Error_QemuDisk_File)}, + {name: `VirtIO errors.New(Error_QemuDiskSerial_IllegalCharacter)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_11: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", Serial: "!@^$^&$^&"}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalCharacter)}, + {name: `VirtIO errors.New(Error_QemuDiskSerial_IllegalLength)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_12: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", Serial: QemuDiskSerial(test_data_qemu.QemuDiskSerial_Max_Illegal())}}}}}, + err: errors.New(Error_QemuDiskSerial_IllegalLength)}, + {name: `VirtIO errors.New(Error_QemuWorldWideName_Invalid)`, + input: ConfigQemu{Disks: &QemuStorages{VirtIO: &QemuVirtIODisks{Disk_13: &QemuVirtIOStorage{Passthrough: &QemuVirtIOPassthrough{File: "/dev/disk/by-id/scsi1", WorldWideName: "0x5004A3B2C1D0E0F1#"}}}}}, + err: errors.New(Error_QemuWorldWideName_Invalid)}}}, + {category: `PoolName`, + valid: []test{ + {name: ``, + input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Legal()))}}, + {name: `Empty`, + input: ConfigQemu{Pool: util.Pointer(PoolName(""))}}}, + invalid: []test{ + {name: `Length`, + input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Max_Illegal()))}, + err: errors.New(PoolName_Error_Length)}, + {name: `Characters`, + input: ConfigQemu{Pool: util.Pointer(PoolName(test_data_pool.PoolName_Error_Characters()[0]))}, + err: errors.New(PoolName_Error_Characters)}}}, + {category: `Tags`, + valid: []test{ + {input: ConfigQemu{Tags: util.Pointer(validTags())}}}, + invalid: []test{ + {name: `errors.New(Tag_Error_Invalid)`, + input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Illegal())})}, + err: errors.New(Tag_Error_Invalid)}, + {name: `errors.New(Tag_Error_Duplicate)`, + input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Max_Legal()), Tag(test_data_tag.Tag_Max_Legal())})}, + err: errors.New(Tag_Error_Duplicate)}, + {name: `errors.New(Tag_Error_Empty)`, + input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Empty())})}, + err: errors.New(Tag_Error_Empty)}, + {name: `errors.New(Tag_Error_MaxLength)`, + input: ConfigQemu{Tags: util.Pointer([]Tag{Tag(test_data_tag.Tag_Max_Illegal())})}, + err: errors.New(Tag_Error_MaxLength)}}}, + {category: `TPM`, + valid: []test{ + {name: `Create`, + input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v2.0"))}}}, + {name: `Update`, + input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v2.0"))}}, + current: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v1.2"))}}}, + {name: `Update Version=nil`, + input: ConfigQemu{TPM: &TpmState{Storage: "test"}}, + current: &ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion("v1.2"))}}}}, + invalid: []test{ + {name: `errors.New(storage is required) Create`, + input: ConfigQemu{TPM: &TpmState{Storage: ""}}, + err: errors.New("storage is required")}, + {name: `errors.New(storage is required) Update`, + input: ConfigQemu{TPM: &TpmState{Storage: ""}}, + current: &ConfigQemu{TPM: &TpmState{}}, + err: errors.New("storage is required")}, + {name: `errors.New(TmpState_Error_VersionRequired) Create`, + input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: nil}}, + err: errors.New(TmpState_Error_VersionRequired)}, + {name: `errors.New(TmpVersion_Error_Invalid) Create`, + input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion(""))}}, + err: errors.New(TpmVersion_Error_Invalid)}, + {name: `errors.New(TmpVersion_Error_Invalid) Update`, + input: ConfigQemu{TPM: &TpmState{Storage: "test", Version: util.Pointer(TpmVersion(""))}}, + current: &ConfigQemu{TPM: &TpmState{}}, + err: errors.New(TpmVersion_Error_Invalid)}}}} + for _, test := range tests { + for _, subTest := range test.valid { + name := test.category + "/Valid" + if len(test.valid) > 1 { + name += "/" + subTest.name + } + t.Run(name, func(*testing.T) { + require.Equal(t, subTest.input.Validate(subTest.current), subTest.err, name) + }) + } + for _, subTest := range test.invalid { + name := test.category + "/Invalid" + if len(test.invalid) > 1 { + name += "/" + subTest.name + } + t.Run(name, func(*testing.T) { + require.Equal(t, subTest.input.Validate(subTest.current), subTest.err, name) }) } } From 3f36f0e96a598d1e24e93a656c67965053b73261 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:13:48 +0200 Subject: [PATCH 4/6] refactor: simplify test --- proxmox/config_qemu_test.go | 38 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index 3a65405c..1bdf948a 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -75,22 +75,6 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { vmr *VmRef output map[string]interface{} } - create := func(t *testing.T, category string, test test) { - name := category + "/Create/" + test.name - t.Run(name, func(*testing.T) { - reboot, tmpParams, _ := test.config.mapToApiValues(ConfigQemu{}) - require.Equal(t, test.output, tmpParams, name) - require.Equal(t, false, reboot, name) - }) - } - update := func(t *testing.T, category string, test test) { - name := category + "/Update/" + test.name - t.Run(name, func(*testing.T) { - reboot, tmpParams, _ := test.config.mapToApiValues(test.currentConfig) - require.Equal(t, test.output, tmpParams, name) - require.Equal(t, test.reboot, reboot, name) - }) - } tests := []struct { category string create []test @@ -3195,15 +3179,21 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { output: map[string]interface{}{"delete": "tpmstate0"}}}}, } for _, test := range tests { - for _, subTest := range test.create { - create(t, test.category, subTest) - } - for _, subTest := range test.createUpdate { - create(t, test.category, subTest) - update(t, test.category, subTest) + for _, subTest := range append(test.create, test.createUpdate...) { + name := test.category + "/Create/" + subTest.name + t.Run(name, func(*testing.T) { + reboot, tmpParams, _ := subTest.config.mapToApiValues(ConfigQemu{}) + require.Equal(t, subTest.output, tmpParams, name) + require.Equal(t, false, reboot, name) + }) } - for _, subTest := range test.update { - update(t, test.category, subTest) + for _, subTest := range append(test.update, test.createUpdate...) { + name := test.category + "/Update/" + subTest.name + t.Run(name, func(*testing.T) { + reboot, tmpParams, _ := subTest.config.mapToApiValues(subTest.currentConfig) + require.Equal(t, subTest.output, tmpParams, name) + require.Equal(t, subTest.reboot, reboot, name) + }) } } } From 88d683e1d870ca5299a60c3da63f93960da85791 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:15:50 +0200 Subject: [PATCH 5/6] refactor: optimize duplicate test cases --- proxmox/config_qemu_test.go | 97 ++++++++++++++----------------------- 1 file changed, 36 insertions(+), 61 deletions(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index 1bdf948a..fc97bff3 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -181,10 +181,38 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { currentConfig: ConfigQemu{Agent: &QemuGuestAgent{}}, output: map[string]interface{}{"agent": "0"}}}}, {category: `CloudInit`, // Create CloudInit no need for update as update and create behave the same. will be changed in the future - create: []test{ + createUpdate: []test{ {name: `CloudInit=nil`, config: &ConfigQemu{}, output: map[string]interface{}{}}, + {name: `CloudInit DNS NameServers`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ + NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, + output: map[string]interface{}{"nameserver": "9.9.9.9"}}, + {name: `CloudInit DNS SearchDomain`, + config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, + output: map[string]interface{}{"searchdomain": "example.com"}}, + {name: `CloudInit PublicSSHkeys`, + config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, + output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, + {name: `CloudInit UpgradePackages`, + config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(true)}}, + output: map[string]interface{}{"ciupgrade": 0}}, + {name: `CloudInit Username`, + config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, + output: map[string]interface{}{"ciuser": "root"}}, + {name: `CloudInit UserPassword`, + config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, + currentConfig: ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Abc123!")}}, + output: map[string]interface{}{"cipassword": "Enter123!"}}, + }, + create: []test{ {name: `CloudInit Full`, config: &ConfigQemu{CloudInit: &CloudInit{ Custom: &CloudInitCustom{ @@ -248,17 +276,10 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { Storage: "local-zfs", FilePath: "ci-meta.yml"}}}}, output: map[string]interface{}{"cicustom": "meta=local-zfs:ci-meta.yml"}}, - {name: `CloudInit DNS NameServers`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, - output: map[string]interface{}{"nameserver": "9.9.9.9"}}, {name: `CloudInit DNS NameServers empty`, config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ NameServers: &[]netip.Addr{}}}}, output: map[string]interface{}{}}, - {name: `CloudInit DNS SearchDomain`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, - output: map[string]interface{}{"searchdomain": "example.com"}}, {name: `CloudInit DNS SearchDomain empty`, config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, output: map[string]interface{}{}}, @@ -273,28 +294,13 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { output: map[string]interface{}{ "ipconfig1": "ip=dhcp,ip6=dhcp", "ipconfig30": "ip=10.20.4.7/22"}}, - {name: `CloudInit PublicSSHkeys`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, - output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, {name: `CloudInit PublicSSHkeys empty`, config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, output: map[string]interface{}{}}, - {name: `CloudInit UpgradePackages`, - config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, - output: map[string]interface{}{"ciupgrade": 0}}, - {name: `CloudInit UserPassword`, - config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, - output: map[string]interface{}{"cipassword": "Enter123!"}}, - {name: `CloudInit Username`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, - output: map[string]interface{}{"ciuser": "root"}}, {name: `CloudInit Username empty`, config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, output: map[string]interface{}{}}}, update: []test{ - {name: `CloudInit=nil`, - config: &ConfigQemu{}, - output: map[string]interface{}{}}, {name: `CloudInit Custom clear`, config: &ConfigQemu{CloudInit: &CloudInit{Custom: &CloudInitCustom{ Meta: &CloudInitSnippet{}, @@ -331,22 +337,12 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { FilePath: "new.yml"}}}}, currentConfig: ConfigQemu{CloudInit: &CloudInit{Custom: cloudInitCustom()}}, output: map[string]interface{}{"cicustom": "meta=newStorage:new.yml,network=local-lvm:ci-network.yml,user=folder:ci-user.yml,vendor=local:snippets/ci-custom.yml"}}, - {name: `CloudInit DNS NameServers`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("9.9.9.9")}}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ - NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, - output: map[string]interface{}{"nameserver": "9.9.9.9"}}, {name: `CloudInit DNS NameServers empty`, config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ NameServers: &[]netip.Addr{}}}}, currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{ NameServers: &[]netip.Addr{parseIP("8.8.8.8")}}}}, output: map[string]interface{}{"delete": "nameserver"}}, - {name: `CloudInit DNS SearchDomain`, - config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.com")}}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, - output: map[string]interface{}{"searchdomain": "example.com"}}, {name: `CloudInit DNS SearchDomain empty`, config: &ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("")}}}, currentConfig: ConfigQemu{CloudInit: &CloudInit{DNS: &GuestDNS{SearchDomain: util.Pointer("example.org")}}}, @@ -566,26 +562,10 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { "ipconfig12": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=2001:0db8:abcd::/48", "ipconfig13": "ip=192.168.56.30/24,gw=192.168.56.1,ip6=auto", "delete": "ipconfig14"}}, - {name: `CloudInit PublicSSHkeys`, - config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer(test_data_qemu.PublicKey_Decoded_Input())}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, - output: map[string]interface{}{"sshkeys": test_data_qemu.PublicKey_Encoded_Output()}}, {name: `CloudInit PublicSSHkeys empty`, config: &ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{})}}, currentConfig: ConfigQemu{CloudInit: &CloudInit{PublicSSHkeys: util.Pointer([]crypto.PublicKey{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+0roY6F4yzq5RfA6V2+8gOgKlLOg9RtB1uGyTYvOMU6wxWUXVZP44+XozNxXZK4/MfPjCZLomqv78RlAedIQbqU8l6J9fdrrsRt6NknusE36UqD4HGPLX3Wn7svjSyNRfrjlk5BrBQ26rglLGlRSeD/xWvQ+5jLzzdo5NczszGkE9IQtrmKye7Gq7NQeGkHb1h0yGH7nMQ48WJ6ZKv1JG+GzFb8n4Qoei3zK9zpWxF+0AzF5u/zzCRZ4yU7FtfHgGRBDPze8oe3nVe+aO8MBH2dy8G/BRMXBdjWrSkaT9ZyeaT0k9SMjsCr9DQzUtVSOeqZZokpNU1dVglI+HU0vN test-key"})}}, output: map[string]interface{}{"delete": "sshkeys"}}, - {name: `CloudInit UpgradePackages`, - config: &ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(false)}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{UpgradePackages: util.Pointer(true)}}, - output: map[string]interface{}{"ciupgrade": 0}}, - {name: `CloudInit UserPassword`, - config: &ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Enter123!")}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{UserPassword: util.Pointer("Abc123!")}}, - output: map[string]interface{}{"cipassword": "Enter123!"}}, - {name: `CloudInit Username`, - config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("root")}}, - currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, - output: map[string]interface{}{"ciuser": "root"}}, {name: `CloudInit Username empty`, config: &ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("")}}, currentConfig: ConfigQemu{CloudInit: &CloudInit{Username: util.Pointer("admin")}}, @@ -3147,20 +3127,15 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { config: &ConfigQemu{Iso: &IsoFile{Storage: "NewStorage", File: "file.iso"}}, output: map[string]interface{}{"ide2": "NewStorage:iso/file.iso,media=cdrom"}}}}, {category: `Tags`, - create: []test{ + createUpdate: []test{ {name: `Tags Empty`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, - output: map[string]interface{}{"tags": string("")}}, + currentConfig: ConfigQemu{Tags: util.Pointer([]Tag{"tag5", "tag6"})}, + config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, + output: map[string]interface{}{"tags": string("")}}, {name: `Tags Full`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, - output: map[string]interface{}{"tags": string("tag1;tag2")}}}, - update: []test{ - {name: `Update Tags Empty`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{})}, - output: map[string]interface{}{"tags": string("")}}, - {name: `Update Tags Full`, - config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, - output: map[string]interface{}{"tags": string("tag1;tag2")}}}}, + currentConfig: ConfigQemu{Tags: util.Pointer([]Tag{"tag5", "tag6"})}, + config: &ConfigQemu{Tags: util.Pointer([]Tag{"tag1", "tag2"})}, + output: map[string]interface{}{"tags": string("tag1;tag2")}}}}, {category: `TPM`, create: []test{ {name: `TPM`, From e27f3c0aff414a7c37ffd97379520992557bd8c8 Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:29:09 +0200 Subject: [PATCH 6/6] remove unused field --- proxmox/config_qemu_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/proxmox/config_qemu_test.go b/proxmox/config_qemu_test.go index fc97bff3..90319d30 100644 --- a/proxmox/config_qemu_test.go +++ b/proxmox/config_qemu_test.go @@ -72,7 +72,6 @@ func Test_ConfigQemu_mapToApiValues(t *testing.T) { config *ConfigQemu currentConfig ConfigQemu reboot bool - vmr *VmRef output map[string]interface{} } tests := []struct {