-
Notifications
You must be signed in to change notification settings - Fork 1.2k
qemu: Respect the JSON schema for hot plug #11667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@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>
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks @c3d !
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:
Fix that by changing the core-id, socket-id and thread-id to be integer values.
Fixes: #11633