mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
elf2dmp: use Linux mmap with MAP_NORESERVE when possible
Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and MAP_PRIVATE. This leads to premature physical memory allocation of dump file size on Linux hosts and may fail. On Linux, mapping the file with MAP_NORESERVE limits the allocation by available memory. Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-5-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
9b7dcd8ff4
commit
df7a75564e
2 changed files with 58 additions and 12 deletions
|
@ -32,7 +32,9 @@ typedef struct QEMUCPUState {
|
|||
int is_system(QEMUCPUState *s);
|
||||
|
||||
typedef struct QEMU_Elf {
|
||||
#ifndef CONFIG_LINUX
|
||||
GMappedFile *gmf;
|
||||
#endif
|
||||
size_t size;
|
||||
void *map;
|
||||
QEMUCPUState **state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue