From 7668aeb526803317d367f9ffbd84d5f09a883301 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Fri, 26 Jul 2019 15:06:36 +0000 Subject: [PATCH] virtcontainers: support SMP die CPU topology has changed in QEMU 4.1: socket > die > core > thread. die option must be specified in order to hotplug CPUs on x86_64 Depends-on: github.com/kata-containers/packaging#657 fixes #1913 Signed-off-by: Julio Montes --- virtcontainers/qemu.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index 902e35e64c..60a6580475 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -1307,6 +1307,7 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) { driver := hc.Type cpuID := fmt.Sprintf("cpu-%d", len(q.state.HotpluggedVCPUs)) socketID := fmt.Sprintf("%d", hc.Properties.Socket) + dieID := fmt.Sprintf("%d", hc.Properties.Die) coreID := fmt.Sprintf("%d", hc.Properties.Core) threadID := fmt.Sprintf("%d", hc.Properties.Thread) @@ -1314,9 +1315,10 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) { if machine.Type == "pseries" || machine.Type == "s390-ccw-virtio" { socketID = "" threadID = "" + dieID = "" } - if err := q.qmpMonitorCh.qmp.ExecuteCPUDeviceAdd(q.qmpMonitorCh.ctx, driver, cpuID, socketID, coreID, threadID, romFile); err != nil { + if err := q.qmpMonitorCh.qmp.ExecuteCPUDeviceAdd(q.qmpMonitorCh.ctx, driver, cpuID, socketID, dieID, coreID, threadID, romFile); err != nil { // don't fail, let's try with other CPU continue }