[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] elf-ops.h: Map into memory the ELF to load
From: |
Stefano Garzarella |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] elf-ops.h: Map into memory the ELF to load |
Date: |
Tue, 23 Jul 2019 12:10:19 +0200 |
User-agent: |
NeoMutt/20180716 |
On Tue, Jul 23, 2019 at 11:49:13AM +0200, Paolo Bonzini wrote:
> On 23/07/19 11:42, Stefano Garzarella wrote:
> > "If writable is TRUE, the mapped buffer may be modified, otherwise it is an
> > error to modify the mapped buffer. Modifications to the buffer are not
> > visible
> > to other processes mapping the same file, and are not written back to the
> > file."
> >
> > I don't know what "error" means, but reading the second part I thought
> > the changes in that case were only visible at the current process.
>
> My reading would be that the second part applies to the writable==TRUE
> case. In fact, the glib source code agrees:
>
> file->contents = (gchar *) mmap (NULL, file->length,
> writable ? PROT_READ|PROT_WRITE : PROT_READ,
> MAP_PRIVATE, fd, 0);
>
> meaning that we could after all just use writable == true.
Thanks for checking! I'll use writable == true in the v2!
Stefano
[Qemu-devel] [PATCH 2/2] hw/i386/pc: Map into memory the initrd, Stefano Garzarella, 2019/07/23