Skip to content

Conversation

c3d
Copy link
Member

@c3d c3d commented Aug 6, 2025

When hot-plugging CPUs on QEMU, we send a QMP command with JSON arguments. QEMU 9.2 recently became more strict1 enforcing the JSON schema for QMP parameters. As a result, running Kata Containers with QEMU 9.2 results in a message complaining that the core-id parameter is expected to be an integer:

qmp hotplug cpu, cpuID=cpu-0 socketID=1, error:
QMP command failed:
Invalid parameter type for 'core-id', expected: integer

Fix that by changing the core-id, socket-id and thread-id to be integer values.

Fixes: #11633

@sprt
Copy link
Contributor

sprt commented Aug 6, 2025

@c3d Could you sign off your commit message to pass this check? 🙂 https://github.com/kata-containers/kata-containers/actions/runs/16783299706/job/47527438036?pr=11667

@c3d
Copy link
Member Author

c3d commented Aug 7, 2025

@c3d Could you sign off your commit message to pass this check? 🙂 https://github.com/kata-containers/kata-containers/actions/runs/16783299706/job/47527438036?pr=11667

Ooops. I normally have auto-signoff set, but I was working from an unusual environment (I'm currently moving). Fixed, thanks for reporting.

When hot-plugging CPUs on QEMU, we send a QMP command with JSON
arguments. QEMU 9.2 recently became more strict[1] enforcing the
JSON schema for QMP parameters. As a result, running Kata Containers
with QEMU 9.2 results in a message complaining that the core-id
parameter is expected to be an integer:

```
qmp hotplug cpu, cpuID=cpu-0 socketID=1, error:
QMP command failed:
Invalid parameter type for 'core-id', expected: integer
```

Fix that by changing the core-id, socket-id and thread-id to be
integer values.

[1]: qemu/qemu@be93fd5

Fixes: kata-containers#11633

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
Copy link
Member

@fidencio fidencio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @c3d!

args := map[string]interface{}{
"driver": driver,
"id": cpuID,
"core-id": coreID,
}

if socketID != "" && isSocketIDSupported(driver) {
if socketID >= 0 && isSocketIDSupported(driver) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could arguably error out if socketID < 0 instead of considering any negative value to mean "not set" but this shouldn't delay this fix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I now see that -1 is used as a default value for some platforms. Let's keep the code simple then. Please forget my previous comment.

Copy link
Member

@gkurz gkurz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks @c3d !

@gkurz gkurz merged commit f9a6359 into kata-containers:main Aug 7, 2025
507 of 539 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QMP command failed: Invalid parameter type for 'core-id', expected: integer" hotplug=cpu name=containerd-shim-v2
5 participants