From 04bbce8dc3288b650234fc1e9b8ba55e4dc32d8b Mon Sep 17 00:00:00 2001 From: "wangyongchao.bj" Date: Thu, 22 Sep 2022 18:39:05 +0800 Subject: [PATCH] virtcontainers: add warn log record for qmp hotplug cpu error The qmp command of hotplug cpu failed error was hidden. It didn't friendly for the user tracing the hotplug cpu error. The PR help us to improve the hotplug cpu error log. Add real qemu command error log for `failed to hot add vCPUs`. Through the error message, we can get the reason of the failed qmp command for hotplug cpu operation. Fixes: #5234 Signed-off-by: wangyongchao.bj --- src/runtime/virtcontainers/qemu.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index 785aa0182c..b7f9601c13 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -1913,6 +1913,7 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) { } if err := q.qmpMonitorCh.qmp.ExecuteCPUDeviceAdd(q.qmpMonitorCh.ctx, driver, cpuID, socketID, dieID, coreID, threadID, romFile); err != nil { + q.Logger().WithField("hotplug", "cpu").Warnf("qmp hotplug cpu, cpuID=%s socketID=%s, error: %v", cpuID, socketID, err) // don't fail, let's try with other CPU continue }