mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 17:22:33 +00:00
ppc64le: Fix vCPU hotplug issue
ppc64le qemu does not need threadID and socketID parameters when hotplugging. Fixes: #1155 Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
This commit is contained in:
parent
726df9dad8
commit
b0986a5f7f
@ -1077,6 +1077,11 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) {
|
||||
return 0, fmt.Errorf("failed to query hotpluggable CPUs: %v", err)
|
||||
}
|
||||
|
||||
machine, err := q.arch.machine()
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("failed to query machine type: %v", err)
|
||||
}
|
||||
|
||||
var hotpluggedVCPUs uint32
|
||||
for _, hc := range hotpluggableVCPUs {
|
||||
// qom-path is the path to the CPU, non-empty means that this CPU is already in use
|
||||
@ -1090,6 +1095,13 @@ func (q *qemu) hotplugAddCPUs(amount uint32) (uint32, error) {
|
||||
socketID := fmt.Sprintf("%d", hc.Properties.Socket)
|
||||
coreID := fmt.Sprintf("%d", hc.Properties.Core)
|
||||
threadID := fmt.Sprintf("%d", hc.Properties.Thread)
|
||||
|
||||
// If CPU type is IBM pSeries, we do not set socketID and threadID
|
||||
if machine.Type == "pseries" {
|
||||
socketID = ""
|
||||
threadID = ""
|
||||
}
|
||||
|
||||
if err := q.qmpMonitorCh.qmp.ExecuteCPUDeviceAdd(q.qmpMonitorCh.ctx, driver, cpuID, socketID, coreID, threadID, romFile); err != nil {
|
||||
// don't fail, let's try with other CPU
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user