mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 18:23:12 +00:00
Merge pull request #84 from nitkon/master
qmp: Conditionally pass threadID and socketID when CPU device add
This commit is contained in:
commit
78d079db6d
13
qemu/qmp.go
13
qemu/qmp.go
@ -1144,14 +1144,21 @@ func (q *QMP) ExecutePCIVFIOMediatedDeviceAdd(ctx context.Context, devID, sysfsd
|
|||||||
// ExecuteCPUDeviceAdd adds a CPU to a QEMU instance using the device_add command.
|
// ExecuteCPUDeviceAdd adds a CPU to a QEMU instance using the device_add command.
|
||||||
// driver is the CPU model, cpuID must be a unique ID to identify the CPU, socketID is the socket number within
|
// driver is the CPU model, cpuID must be a unique ID to identify the CPU, socketID is the socket number within
|
||||||
// node/board the CPU belongs to, coreID is the core number within socket the CPU belongs to, threadID is the
|
// node/board the CPU belongs to, coreID is the core number within socket the CPU belongs to, threadID is the
|
||||||
// thread number within core the CPU belongs to.
|
// thread number within core the CPU belongs to. Note that socketID and threadID are not a requirement for
|
||||||
|
// architecures like ppc64le.
|
||||||
func (q *QMP) ExecuteCPUDeviceAdd(ctx context.Context, driver, cpuID, socketID, coreID, threadID, romfile string) error {
|
func (q *QMP) ExecuteCPUDeviceAdd(ctx context.Context, driver, cpuID, socketID, coreID, threadID, romfile string) error {
|
||||||
args := map[string]interface{}{
|
args := map[string]interface{}{
|
||||||
"driver": driver,
|
"driver": driver,
|
||||||
"id": cpuID,
|
"id": cpuID,
|
||||||
"socket-id": socketID,
|
|
||||||
"core-id": coreID,
|
"core-id": coreID,
|
||||||
"thread-id": threadID,
|
}
|
||||||
|
|
||||||
|
if socketID != "" {
|
||||||
|
args["socket-id"] = socketID
|
||||||
|
}
|
||||||
|
|
||||||
|
if threadID != "" {
|
||||||
|
args["thread-id"] = threadID
|
||||||
}
|
}
|
||||||
|
|
||||||
if isVirtioPCI[DeviceDriver(driver)] {
|
if isVirtioPCI[DeviceDriver(driver)] {
|
||||||
|
Loading…
Reference in New Issue
Block a user