mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 09:13:29 +00:00
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 <julio.montes@intel.com>
This commit is contained in:
parent
104c04d28f
commit
7668aeb526
@ -1307,6 +1307,7 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) {
|
|||||||
driver := hc.Type
|
driver := hc.Type
|
||||||
cpuID := fmt.Sprintf("cpu-%d", len(q.state.HotpluggedVCPUs))
|
cpuID := fmt.Sprintf("cpu-%d", len(q.state.HotpluggedVCPUs))
|
||||||
socketID := fmt.Sprintf("%d", hc.Properties.Socket)
|
socketID := fmt.Sprintf("%d", hc.Properties.Socket)
|
||||||
|
dieID := fmt.Sprintf("%d", hc.Properties.Die)
|
||||||
coreID := fmt.Sprintf("%d", hc.Properties.Core)
|
coreID := fmt.Sprintf("%d", hc.Properties.Core)
|
||||||
threadID := fmt.Sprintf("%d", hc.Properties.Thread)
|
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" {
|
if machine.Type == "pseries" || machine.Type == "s390-ccw-virtio" {
|
||||||
socketID = ""
|
socketID = ""
|
||||||
threadID = ""
|
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
|
// don't fail, let's try with other CPU
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user