vendor: update govmm

bring `pmem` option to pmem/nvdimm devices

shortlog:
qemu: add pmem flag to memory-backend-file

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2020-03-06 16:39:45 +00:00
parent aa0d4ee0e8
commit 2c7f27ec4f
3 changed files with 14 additions and 5 deletions

4
Gopkg.lock generated
View File

@ -412,11 +412,11 @@
revision = "2f1d1f20f75d5404f53b9edf6b53ed5505508675"
[[projects]]
digest = "1:0044fb81f517f480ca3c33675a3af6b4ada77a6faf699a302bc2388c98cacba9"
digest = "1:fafdb4aa5b6207f51ec7557818d5f7a534ed44ea4fb31c6f2e8abb01d1627b74"
name = "github.com/intel/govmm"
packages = ["qemu"]
pruneopts = "NUT"
revision = "3700c55dd766d37e17af354fb9975dc801619d62"
revision = "e969afbec52cf687bbe97b76654c664128cdb04b"
[[projects]]
digest = "1:d6e9b99fe0150d4c26d81612676e8d59ad045642e4cbc8646e494b50d4f245ef"

View File

@ -48,7 +48,7 @@
[[constraint]]
name = "github.com/intel/govmm"
revision = "3700c55dd766d37e17af354fb9975dc801619d62"
revision = "e969afbec52cf687bbe97b76654c664128cdb04b"
[[constraint]]
name = "github.com/kata-containers/agent"

View File

@ -1428,8 +1428,9 @@ func (q *QMP) ExecHotplugMemory(ctx context.Context, qomtype, id, mempath string
// a NVDIMM driver with the device_add command.
// id is the id of the device to add. It must be a valid QMP identifier.
// mempath is the path of the device to add, e.g., /dev/rdb0. size is
// the data size of the device.
func (q *QMP) ExecuteNVDIMMDeviceAdd(ctx context.Context, id, mempath string, size int64) error {
// the data size of the device. pmem is to guarantee the persistence of QEMU writes
// to the vNVDIMM backend.
func (q *QMP) ExecuteNVDIMMDeviceAdd(ctx context.Context, id, mempath string, size int64, pmem *bool) error {
args := map[string]interface{}{
"qom-type": "memory-backend-file",
"id": "nvdimmbackmem" + id,
@ -1439,6 +1440,14 @@ func (q *QMP) ExecuteNVDIMMDeviceAdd(ctx context.Context, id, mempath string, si
"share": true,
},
}
if q.version.Major > 4 || (q.version.Major == 4 && q.version.Minor >= 1) {
if pmem != nil {
props := args["props"].(map[string]interface{})
props["pmem"] = *pmem
}
}
err := q.executeCommand(ctx, "object-add", args, nil)
if err != nil {
return err