-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packages/kata-runtime: correctly type QMP commands
This pulls in an upstream patch (kata-containers/kata-containers@92cc0e2) which correctly types the QMP `device_add` command options. This is required to make Kata work with QEMU >= 9.2.0.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...by-name/kata/kata-runtime/0018-runtime-use-actual-booleans-for-QMP-device_add-boole.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Moritz Sanft <58110325+msanft@users.noreply.github.com> | ||
Date: Wed, 8 Jan 2025 16:13:49 +0100 | ||
Subject: [PATCH] runtime: use actual booleans for QMP `device_add` boolean | ||
options | ||
|
||
Since | ||
https://github.com/qemu/qemu/commit/be93fd53723cbdca675bd9ed112dae5cabbe1e91, | ||
which is included in QEMU since version 9.2.0, the options for the | ||
`device_add` QMP command need to be typed correctly. | ||
|
||
This makes it so that instead of `"on"`, the value is set to `true`, | ||
matching QEMU's expectations. | ||
|
||
This has been tested on QEMU 9.2.0 and QEMU 9.1.2, so before and after | ||
the change. | ||
|
||
The compatibility with incorrectly typed options for the `device_add` | ||
command is deprecated since version 6.2.0 [^1]. | ||
|
||
[^1]: https://qemu-project.gitlab.io/qemu/about/deprecated.html#incorrectly-typed-device-add-arguments-since-6-2 | ||
--- | ||
src/runtime/pkg/govmm/qemu/qmp.go | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/src/runtime/pkg/govmm/qemu/qmp.go b/src/runtime/pkg/govmm/qemu/qmp.go | ||
index bf18bef9fc027cbf8c77c169ae2b36fdcbdaaa44..af907ba56e514e7fa8c1fc71175c2d039fef9010 100644 | ||
--- a/src/runtime/pkg/govmm/qemu/qmp.go | ||
+++ b/src/runtime/pkg/govmm/qemu/qmp.go | ||
@@ -869,7 +869,7 @@ func (q *QMP) ExecuteDeviceAdd(ctx context.Context, blockdevID, devID, driver, b | ||
} | ||
|
||
if shared { | ||
- args["share-rw"] = "on" | ||
+ args["share-rw"] = true | ||
} | ||
if transport.isVirtioPCI(nil) { | ||
args["romfile"] = romfile | ||
@@ -923,7 +923,7 @@ func (q *QMP) ExecuteSCSIDeviceAdd(ctx context.Context, blockdevID, devID, drive | ||
args["lun"] = lun | ||
} | ||
if shared { | ||
- args["share-rw"] = "on" | ||
+ args["share-rw"] = true | ||
} | ||
|
||
return q.executeCommand(ctx, "device_add", args, nil) | ||
@@ -1113,7 +1113,7 @@ func (q *QMP) ExecutePCIDeviceAdd(ctx context.Context, blockdevID, devID, driver | ||
args["bus"] = bus | ||
} | ||
if shared { | ||
- args["share-rw"] = "on" | ||
+ args["share-rw"] = true | ||
} | ||
if queues > 0 { | ||
args["num-queues"] = strconv.Itoa(queues) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters