diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index dd654056b0..5a3af8977e 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -1160,7 +1160,7 @@ func (q *qemu) hotplugMemory(memDev *memoryDevice, op operation) (int, error) { if currentMemory+memDev.sizeMB > int(maxMem) { // Fixme: return a typed error return 0, fmt.Errorf("Unable to hotplug %d MiB memory, the SB has %d MiB and the maximum amount is %d MiB", - memDev.sizeMB, currentMemory, q.config.MemorySize) + memDev.sizeMB, currentMemory, maxMem) } memoryAdded, err := q.hotplugAddMemory(memDev) if err != nil {