qemu-e2k/include
Stefan Hajnoczi 369d6dc4de 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>
2021-02-01 17:07:34 -05:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block block/block-copy: drop unused argument of block_copy() 2021-01-26 14:36:37 +01:00
chardev chardev: do not use machine_init_done 2020-12-15 12:51:51 -05:00
crypto qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
disas disas: Push const down through host disassembly 2021-01-07 05:09:42 -10:00
exec memory: add readonly support to memory_region_init_ram_from_file() 2021-02-01 17:07:34 -05:00
fpu softfloat: Define comparison operations for bfloat16 2020-08-29 19:25:42 -07:00
hw arm: Remove frq properties on CMSDK timer, dualtimer, watchdog, ARMSSE 2021-01-29 15:54:44 +00:00
io io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown 2021-01-13 10:21:17 +01:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migration: Replace migration's JSON writer by the general one 2020-12-19 10:39:16 +01:00
monitor sev: add sev-inject-launch-secret 2020-12-10 17:33:17 -05:00
net net: checksum: Introduce fine control over checksum type 2021-01-25 17:04:56 +08:00
qapi qapi: Introduce QAPI_LIST_APPEND 2021-01-28 08:08:45 +01:00
qemu memory: add readonly support to memory_region_init_ram_from_file() 2021-02-01 17:07:34 -05:00
qom qom: Add user_creatable_print_help_from_qdict() 2020-10-15 16:06:27 +02:00
scsi scsi/utils: Add INVALID_PARAM_VALUE sense code definition 2021-01-22 14:51:35 +01:00
standard-headers Update linux headers to 5.11-rc2 2021-01-21 11:19:45 +01:00
sysemu block: Separate blk_is_writable() and blk_supports_write_perm() 2021-01-27 20:45:20 +01:00
tcg tcg: Restart code generation when we run out of temps 2021-01-24 08:03:27 -10:00
ui vnc: support "-vnc help" 2021-01-23 15:55:07 -05:00
user trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
elf.h target-arm queue: 2020-10-29 11:40:04 +00:00
glib-compat.h glib-compat: add g_unix_get_passwd_entry_qemu() 2020-11-02 19:52:08 -06:00
qemu-common.h vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00