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 <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz 2019-01-11 13:34:32 -06:00
parent d4dd5f1508
commit a5a74f6d20

View File

@ -1160,7 +1160,7 @@ func (q *qemu) hotplugMemory(memDev *memoryDevice, op operation) (int, error) {
if currentMemory+memDev.sizeMB > int(maxMem) { if currentMemory+memDev.sizeMB > int(maxMem) {
// Fixme: return a typed error // 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", 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) memoryAdded, err := q.hotplugAddMemory(memDev)
if err != nil { if err != nil {