Skip to content

nvdimm: read-only file support

Stefan Hajnoczi qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 9 repliesSuperseded
  3. v13 patches 11 repliesSuperseded

Changes in v3 from the cover letter

* Produce an error when -device nvdimm,unarmed=off is used with -object memory-backend-file,readonly=on instead of silently switching on unarmed. [Igor]
* Use Object *obj instead of Object *o [Igor]
* Do not dereference MEMORY_BACKEND_FILE(o)->readonly directly, use a local variable to hold the HostMemoryBackendFile pointer. [Igor]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3memory: add readonly support to memory_region_init_ram_from_file()backends/hostmem-file.c include/exec/memory.h include/exec/ram_addr.h +5 more+31 -170 replies
2/3hostmem-file: add readonly=on|off optionbackends/hostmem-file.c qemu-options.hx+31 -20 replies
3/3nvdimm: check -object memory-backend-file, readonly=on optiondocs/nvdimm.txt hw/mem/nvdimm.c+26 -70 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMichael S. TsirkinPhilippe Mathieu-DaudéLiam MerwickIgor Mammedov
1/3A-b R-b R-b R-b
2/3A-b R-b R-b
3/3A-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/3] nvdimm: read-only file support

v3:
* Produce an error when -device nvdimm,unarmed=off is used with -object memory-backend-file,readonly=on instead of silently switching on unarmed. [Igor]
* Use Object *obj instead of Object *o [Igor]
* Do not dereference MEMORY_BACKEND_FILE(o)->readonly directly, use a local variable to hold the HostMemoryBackendFile pointer. [Igor]
v2:
* s/the the/the/ in documentation [Philippe]
* Assign nvdimm->unarmed earlier [Philippe]

There is currently no way to back an NVDIMM with a read-only file so it can be safely shared between untrusted guests.

Introduce an -object memory-backend-file,readonly=on|off option.

Julio Montes sent an earlier patch here:
https://patchew.org/QEMU/[email protected]/

Eric Ernst requested this feature again for Kata Containers so I gave it a try.

Stefan Hajnoczi (3):
memory: add readonly support to memory_region_init_ram_from_file()
hostmem-file: add readonly=on|off option
nvdimm: check -object memory-backend-file,readonly=on option

 docs/nvdimm.txt           | 24 +++++++++++++++++-------
 include/exec/memory.h     |  2 ++
 include/exec/ram_addr.h   |  5 +++--
 include/qemu/mmap-alloc.h |  2 ++
 backends/hostmem-file.c   | 28 +++++++++++++++++++++++++++-
 hw/mem/nvdimm.c           |  9 +++++++++
 softmmu/memory.c          |  7 +++++--
 softmmu/physmem.c         | 18 +++++++++++-------
 util/mmap-alloc.c         | 10 ++++++----
 util/oslib-posix.c        |  2 +-
 qemu-options.hx           |  5 ++++-
 11 files changed, 87 insertions(+), 25 deletions(-)
Signature · 1 line
2.29.2