mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
qmp: Don't use deprecated 'props' field for object-add
Use of the 'props' argument to 'object-add' has been deprecated since QEMU 5.0 (commit 5f07c4d60d09) in favor of flattening the properties directly into the 'object-add' arguments. Support for 'props' is removed entirely in qemu 6.0 (commit 50243407457a). fixes #193 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d8cdf9aa2a
commit
d27256f863
18
qemu/qmp.go
18
qemu/qmp.go
@ -1366,17 +1366,16 @@ func (q *QMP) ExecQueryCpusFast(ctx context.Context) ([]CPUInfoFast, error) {
|
||||
|
||||
// ExecMemdevAdd adds size of MiB memory device to the guest
|
||||
func (q *QMP) ExecMemdevAdd(ctx context.Context, qomtype, id, mempath string, size int, share bool, driver, driverID, addr, bus string) error {
|
||||
props := map[string]interface{}{"size": uint64(size) << 20}
|
||||
args := map[string]interface{}{
|
||||
"qom-type": qomtype,
|
||||
"id": id,
|
||||
"props": props,
|
||||
"size": uint64(size) << 20,
|
||||
}
|
||||
if mempath != "" {
|
||||
props["mem-path"] = mempath
|
||||
args["mem-path"] = mempath
|
||||
}
|
||||
if share {
|
||||
props["share"] = true
|
||||
args["share"] = true
|
||||
}
|
||||
err := q.executeCommand(ctx, "object-add", args, nil)
|
||||
if err != nil {
|
||||
@ -1426,16 +1425,13 @@ func (q *QMP) ExecuteNVDIMMDeviceAdd(ctx context.Context, id, mempath string, si
|
||||
args := map[string]interface{}{
|
||||
"qom-type": "memory-backend-file",
|
||||
"id": "nvdimmbackmem" + id,
|
||||
"props": map[string]interface{}{
|
||||
"mem-path": mempath,
|
||||
"size": size,
|
||||
"share": true,
|
||||
},
|
||||
"mem-path": mempath,
|
||||
"size": size,
|
||||
"share": true,
|
||||
}
|
||||
|
||||
if pmem != nil {
|
||||
props := args["props"].(map[string]interface{})
|
||||
props["pmem"] = *pmem
|
||||
args["pmem"] = *pmem
|
||||
}
|
||||
|
||||
err := q.executeCommand(ctx, "object-add", args, nil)
|
||||
|
Loading…
Reference in New Issue
Block a user