Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
vc: qemu: fix error message on hotplug.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jcvenegas committed Jan 11, 2019
1 parent d4dd5f1 commit a5a74f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a5a74f6

Please sign in to comment.