diff --git a/qemu/qemu.go b/qemu/qemu.go index 4cb18d10ad..daac268bdb 100644 --- a/qemu/qemu.go +++ b/qemu/qemu.go @@ -1761,7 +1761,9 @@ func (config *Config) appendMemoryKnobs() { if config.Memory.Size == "" { return } - + if !isDimmSupported() { + return + } var objMemParam, numaMemParam string dimmName := "dimm1" if config.Knobs.HugePages { diff --git a/qemu/qemu_arch_base.go b/qemu/qemu_arch_base.go index a7bbed558e..f295099cee 100644 --- a/qemu/qemu_arch_base.go +++ b/qemu/qemu_arch_base.go @@ -105,3 +105,7 @@ func (n NetDeviceType) QemuDeviceParam() DeviceDriver { } } + +func isDimmSupported() bool { + return true +} diff --git a/qemu/qemu_test.go b/qemu/qemu_test.go index 7caba015e9..3c2307858c 100644 --- a/qemu/qemu_test.go +++ b/qemu/qemu_test.go @@ -521,6 +521,10 @@ func TestAppendKnobsAllFalse(t *testing.T) { } func TestAppendMemoryHugePages(t *testing.T) { + if !isDimmSupported() { + t.Skip("Dimm not supported") + } + conf := &Config{ Memory: Memory{ Size: "1G", @@ -545,6 +549,10 @@ func TestAppendMemoryHugePages(t *testing.T) { } func TestAppendMemoryMemPrealloc(t *testing.T) { + if !isDimmSupported() { + t.Skip("Dimm not supported") + } + conf := &Config{ Memory: Memory{ Size: "1G", @@ -567,6 +575,10 @@ func TestAppendMemoryMemPrealloc(t *testing.T) { } func TestAppendMemoryMemShared(t *testing.T) { + if !isDimmSupported() { + t.Skip("Dimm not supported") + } + conf := &Config{ Memory: Memory{ Size: "1G", @@ -589,6 +601,10 @@ func TestAppendMemoryMemShared(t *testing.T) { } func TestAppendMemoryFileBackedMem(t *testing.T) { + if !isDimmSupported() { + t.Skip("Dimm not supported") + } + conf := &Config{ Memory: Memory{ Size: "1G", @@ -611,6 +627,10 @@ func TestAppendMemoryFileBackedMem(t *testing.T) { } func TestAppendMemoryFileBackedMemPrealloc(t *testing.T) { + if !isDimmSupported() { + t.Skip("Dimm not supported") + } + conf := &Config{ Memory: Memory{ Size: "1G", diff --git a/qemu/qemus390x.go b/qemu/qemus390x.go index c52edd67ce..0aeffceeb5 100644 --- a/qemu/qemus390x.go +++ b/qemu/qemus390x.go @@ -134,3 +134,7 @@ func (n NetDeviceType) QemuNetdevParam() string { } } + +func isDimmSupported() bool { + return false +}