summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell2021-02-03 10:54:21 +0100
committerPeter Maydell2021-02-03 10:54:21 +0100
commit8360ebeb4f4a707984cafd1a22c049ec82ddcb4c (patch)
tree9363af79103b6ffcdc40322efa0963770810d9c4 /include
parentMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff)
parentnvdimm: check -object memory-backend-file, readonly=on option (diff)
downloadqemu-8360ebeb4f4a707984cafd1a22c049ec82ddcb4c.tar.gz
qemu-8360ebeb4f4a707984cafd1a22c049ec82ddcb4c.tar.xz
qemu-8360ebeb4f4a707984cafd1a22c049ec82ddcb4c.zip
Merge remote-tracking branch 'remotes/ehabkost-gl/tags/machine-next-pull-request' into staging
Machine queue, 2021-02-02 Feature: * nvdimm: read-only file support (Stefan Hajnoczi) # gpg: Signature made Tue 02 Feb 2021 19:27:21 GMT # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost-gl/tags/machine-next-pull-request: nvdimm: check -object memory-backend-file, readonly=on option hostmem-file: add readonly=on|off option memory: add readonly support to memory_region_init_ram_from_file() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/exec/memory.h2
-rw-r--r--include/exec/ram_addr.h5
-rw-r--r--include/qemu/mmap-alloc.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 521d9901d7..c6ce74fb79 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -966,6 +966,7 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr,
* - RAM_PMEM: the memory is persistent memory
* Other bits are ignored now.
* @path: the path in which to allocate the RAM.
+ * @readonly: true to open @path for reading, false for read/write.
* @errp: pointer to Error*, to store an error if it happens.
*
* Note that this function does not do anything to cause the data in the
@@ -978,6 +979,7 @@ void memory_region_init_ram_from_file(MemoryRegion *mr,
uint64_t align,
uint32_t ram_flags,
const char *path,
+ bool readonly,
Error **errp);
/**
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index c6d2ef1d07..40b16609ab 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -110,6 +110,7 @@ long qemu_maxrampagesize(void);
* - RAM_PMEM: the backend @mem_path or @fd is persistent memory
* Other bits are ignored.
* @mem_path or @fd: specify the backing file or device
+ * @readonly: true to open @path for reading, false for read/write.
* @errp: pointer to Error*, to store an error if it happens
*
* Return:
@@ -118,9 +119,9 @@ long qemu_maxrampagesize(void);
*/
RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
uint32_t ram_flags, const char *mem_path,
- Error **errp);
+ bool readonly, Error **errp);
RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
- uint32_t ram_flags, int fd,
+ uint32_t ram_flags, int fd, bool readonly,
Error **errp);
RAMBlock *qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
index e786266b92..8b7a5c70f3 100644
--- a/include/qemu/mmap-alloc.h
+++ b/include/qemu/mmap-alloc.h
@@ -14,6 +14,7 @@ size_t qemu_mempath_getpagesize(const char *mem_path);
* @size: the number of bytes to be mmaped
* @align: if not zero, specify the alignment of the starting mapping address;
* otherwise, the alignment in use will be determined by QEMU.
+ * @readonly: true for a read-only mapping, false for read/write.
* @shared: map has RAM_SHARED flag.
* @is_pmem: map has RAM_PMEM flag.
*
@@ -24,6 +25,7 @@ size_t qemu_mempath_getpagesize(const char *mem_path);
void *qemu_ram_mmap(int fd,
size_t size,
size_t align,
+ bool readonly,
bool shared,
bool is_pmem);