[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 369d6d: memory: add readonly support to memor
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 369d6d: memory: add readonly support to memory_region_init... |
Date: |
Wed, 03 Feb 2021 04:55:48 -0800 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 369d6dc4de45b8e5e35a851f5719e7fd59a0462f
https://github.com/qemu/qemu/commit/369d6dc4de45b8e5e35a851f5719e7fd59a0462f
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2021-02-01 (Mon, 01 Feb 2021)
Changed paths:
M backends/hostmem-file.c
M include/exec/memory.h
M include/exec/ram_addr.h
M include/qemu/mmap-alloc.h
M softmmu/memory.c
M softmmu/physmem.c
M util/mmap-alloc.c
M util/oslib-posix.c
Log Message:
-----------
memory: add readonly support to memory_region_init_ram_from_file()
There is currently no way to open(O_RDONLY) and mmap(PROT_READ) when
creating a memory region from a file. This functionality is needed since
the underlying host file may not allow writing.
Add a bool readonly argument to memory_region_init_ram_from_file() and
the APIs it calls.
Extend memory_region_init_ram_from_file() rather than introducing a
memory_region_init_rom_from_file() API so that callers can easily make a
choice between read/write and read-only at runtime without calling
different APIs.
No new RAMBlock flag is introduced for read-only because it's unclear
whether RAMBlocks need to know that they are read-only. Pass a bool
readonly argument instead.
Both of these design decisions can be changed in the future. It just
seemed like the simplest approach to me.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20210104171320.575838-2-stefanha@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Commit: 86635aa4e9d627d5142b81c57a33dd1f36627d07
https://github.com/qemu/qemu/commit/86635aa4e9d627d5142b81c57a33dd1f36627d07
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2021-02-01 (Mon, 01 Feb 2021)
Changed paths:
M backends/hostmem-file.c
M qemu-options.hx
Log Message:
-----------
hostmem-file: add readonly=on|off option
Let -object memory-backend-file work on read-only files when the
readonly=on option is given. This can be used to share the contents of a
file between multiple guests while preventing them from consuming
Copy-on-Write memory if guests dirty the pages, for example.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20210104171320.575838-3-stefanha@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Commit: dbd730e8598701e11b2fb7aee1704f4ec1787e86
https://github.com/qemu/qemu/commit/dbd730e8598701e11b2fb7aee1704f4ec1787e86
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2021-02-01 (Mon, 01 Feb 2021)
Changed paths:
M docs/nvdimm.txt
M hw/mem/nvdimm.c
Log Message:
-----------
nvdimm: check -object memory-backend-file, readonly=on option
Check that -device nvdimm,unarmed=on is used when -object
memory-backend-file,readonly=on and document that -device
nvdimm,unarmed=on|off controls whether the NVDIMM appears read-only to
the guest.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20210104171320.575838-4-stefanha@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Commit: 8360ebeb4f4a707984cafd1a22c049ec82ddcb4c
https://github.com/qemu/qemu/commit/8360ebeb4f4a707984cafd1a22c049ec82ddcb4c
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2021-02-03 (Wed, 03 Feb 2021)
Changed paths:
M backends/hostmem-file.c
M docs/nvdimm.txt
M hw/mem/nvdimm.c
M include/exec/memory.h
M include/exec/ram_addr.h
M include/qemu/mmap-alloc.h
M qemu-options.hx
M softmmu/memory.c
M softmmu/physmem.c
M util/mmap-alloc.c
M util/oslib-posix.c
Log Message:
-----------
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>
Compare: https://github.com/qemu/qemu/compare/77f3804ab7ed...8360ebeb4f4a