qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] exec: Fix broken build for MinGW (regression)


From: Markus Armbruster
Subject: Re: [Qemu-trivial] [PATCH] exec: Fix broken build for MinGW (regression)
Date: Wed, 18 Sep 2013 08:43:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Stefan Weil <address@hidden> writes:

> Commit 3435f39513a104294b5e3bbf3612047028d25cfc reduced the ifdeffery with
> this result for MinGW:
>
> exec.c: In function ‘qemu_ram_free’:
> exec.c:1239:17: warning:
>  implicit declaration of function ‘munmap’ [-Wimplicit-function-declaration]
> exec.c:1239:17: warning:
>  nested extern declaration of ‘munmap’ [-Wnested-externs]
> exec.c:1239: undefined reference to `munmap'
>
> Add some ifdeffery again to fix this.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>  exec.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/exec.c b/exec.c
> index 2646912..efeca14 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1229,9 +1229,11 @@ void qemu_ram_free(ram_addr_t addr)
>                  ;
>              } else if (xen_enabled()) {
>                  xen_invalidate_map_cache_entry(block->host);
> +#ifndef _WIN32
>              } else if (block->fd >= 0) {
>                  munmap(block->host, block->length);
>                  close(block->fd);
> +#endif
>              } else {
>                  qemu_anon_ram_free(block->host, block->length);
>              }

The initial mmap() is under #ifdef __linux__, in file_ram_alloc().
However, the code manipulating it in qemu_ram_remap() is under #ifndef
_WIN32, and your patch matches that.  Makes sense.

Thanks for cleaning up after me ;)

Reviewed-by: Markus Armbruster <address@hidden>



reply via email to

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