diff --git a/Gopkg.lock b/Gopkg.lock index 8c4a4b66f5..db5230b28b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -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" diff --git a/Gopkg.toml b/Gopkg.toml index cb981258c0..84b9e446c7 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -48,7 +48,7 @@ [[constraint]] name = "github.com/intel/govmm" - revision = "3700c55dd766d37e17af354fb9975dc801619d62" + revision = "e969afbec52cf687bbe97b76654c664128cdb04b" [[constraint]] name = "github.com/kata-containers/agent" diff --git a/vendor/github.com/intel/govmm/qemu/qmp.go b/vendor/github.com/intel/govmm/qemu/qmp.go index 83ac94a043..bf9a77dda1 100644 --- a/vendor/github.com/intel/govmm/qemu/qmp.go +++ b/vendor/github.com/intel/govmm/qemu/qmp.go @@ -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