From a5a74f6d20f9c6c7cecee6209263b1b867b81244 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 11 Jan 2019 13:34:32 -0600 Subject: [PATCH] vc: qemu: fix error message on hotplug. The error message does not provide the max memory that is exceeded. Fix it for better error information. Fixes: #1120 Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {