mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
vendor: update govmm changes
To include vm factory related commits. Full list:54caf78
(mine/templating, templating) qmp: add hotplug memorye66a9b4
qemu: add appendMemoryKnobs helper8aeca15
qmp: add migrate set argumentsa03d496
qmp: add set migration capabilities0ace417
qemu: allow to set migration incoming723bc5f
qemu: allow to create a stopped guest283d7df
qemu: add file backed memory device support Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
53
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
53
vendor/github.com/intel/govmm/qemu/qmp.go
generated
vendored
@@ -828,3 +828,56 @@ func (q *QMP) ExecuteQueryHotpluggableCPUs(ctx context.Context) ([]HotpluggableC
|
||||
|
||||
return cpus, nil
|
||||
}
|
||||
|
||||
// ExecSetMigrationCaps sets migration capabilities
|
||||
func (q *QMP) ExecSetMigrationCaps(ctx context.Context, caps []map[string]interface{}) error {
|
||||
args := map[string]interface{}{
|
||||
"capabilities": caps,
|
||||
}
|
||||
|
||||
return q.executeCommand(ctx, "migrate-set-capabilities", args, nil)
|
||||
}
|
||||
|
||||
// ExecSetMigrateArguments sets the command line used for migration
|
||||
func (q *QMP) ExecSetMigrateArguments(ctx context.Context, url string) error {
|
||||
args := map[string]interface{}{
|
||||
"uri": url,
|
||||
}
|
||||
|
||||
return q.executeCommand(ctx, "migrate", args, nil)
|
||||
}
|
||||
|
||||
// ExecHotplugMemory adds size of MiB memory to the guest
|
||||
func (q *QMP) ExecHotplugMemory(ctx context.Context, qomtype, id, mempath string, size int) error {
|
||||
args := map[string]interface{}{
|
||||
"qom-type": qomtype,
|
||||
"id": id,
|
||||
"props": map[string]interface{}{"size": uint64(size) << 20},
|
||||
}
|
||||
if mempath != "" {
|
||||
args["mem-path"] = mempath
|
||||
}
|
||||
err := q.executeCommand(ctx, "object-add", args, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
q.cfg.Logger.Errorf("Unable to hotplug memory device: %v", err)
|
||||
err = q.executeCommand(ctx, "object-del", map[string]interface{}{"id": id}, nil)
|
||||
if err != nil {
|
||||
q.cfg.Logger.Warningf("Unable to clean up memory object: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
args = map[string]interface{}{
|
||||
"driver": "pc-dimm",
|
||||
"id": "dimm" + id,
|
||||
"memdev": id,
|
||||
}
|
||||
err = q.executeCommand(ctx, "device_add", args, nil)
|
||||
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user