From d4dd5f15081359f2c8d66728e4b8766e4099d5c4 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Fri, 11 Jan 2019 13:33:01 -0600 Subject: [PATCH 1/2] qemu: fix gofmt import order. use gofmt changes the import order. Signed-off-by: Jose Carlos Venegas Munoz --- virtcontainers/qemu.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index 59d9dbbb1..dd654056b 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -8,10 +8,6 @@ package virtcontainers import ( "context" "fmt" - govmmQemu "github.com/intel/govmm/qemu" - "github.com/kata-containers/runtime/virtcontainers/pkg/uuid" - "github.com/opentracing/opentracing-go" - "github.com/sirupsen/logrus" "math" "os" "path/filepath" @@ -21,6 +17,11 @@ import ( "time" "unsafe" + govmmQemu "github.com/intel/govmm/qemu" + "github.com/kata-containers/runtime/virtcontainers/pkg/uuid" + "github.com/opentracing/opentracing-go" + "github.com/sirupsen/logrus" + "github.com/kata-containers/runtime/virtcontainers/device/config" "github.com/kata-containers/runtime/virtcontainers/types" "github.com/kata-containers/runtime/virtcontainers/utils" 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 2/2] 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 dd654056b..5a3af8977 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 {