qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()


From: Juan Quintela
Subject: Re: [PATCH RFC 10/21] ramblock: Add ramblock_file_map()
Date: Mon, 30 Jan 2023 06:09:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Peter Xu <peterx@redhat.com> wrote:
> Add a helper to do mmap() for a ramblock based on the cached informations.
>
> A trivial thing to mention is we need to move ramblock->fd setup to be
> earlier, before the ramblock_file_map() call, because it'll need to
> reference the fd being mapped.  However that should not be a problem at
> all, majorly because the fd won't be freed if successful, and if it failed
> the fd will be freeed (or to be explicit, close()ed) by the caller.
>
> Export it - prepare to be used outside this file.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>


> +void *ramblock_file_map(RAMBlock *block);

I would have called it:

void *qemu_ram_mmap_file(RAMBlock *block);

To make clear that it is 'like' qemu_ram_mmap(), but for a file.

But that is just a suggestion.  Whoever does the patch, get the right to
name the functions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]