hw/i386/pc: Map into memory the initrd

In order to reduce the memory footprint we map into memory
the initrd using g_mapped_file_new() instead of reading it.
In this way we can share the initrd pages between multiple
instances of QEMU.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20190724143105.307042-4-sgarzare@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Stefano Garzarella 2019-07-24 16:31:05 +02:00 committed by Paolo Bonzini
parent 816b9fe450
commit e502fe96ac
2 changed files with 14 additions and 4 deletions

View file

@ -41,6 +41,7 @@ struct PCMachineState {
FWCfgState *fw_cfg;
qemu_irq *gsi;
PFlashCFI01 *flash[2];
GMappedFile *initrd_mapped_file;
/* Configuration options: */
uint64_t max_ram_below_4g;