[PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c

Peter Xu posted 21 patches 3 years ago
Maintainers: David Hildenbrand <david@redhat.com>, Igor Mammedov <imammedo@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Cornelia Huck <cohuck@redhat.com>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
[PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c
Posted by Peter Xu 3 years ago
Without it, we never have CONFIG_LINUX defined even if on linux, so
linux/mman.h is never really included.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 util/mmap-alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 5ed7d29183..040599b0e3 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -9,6 +9,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or
  * later.  See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 
 #ifdef CONFIG_LINUX
 #include <linux/mman.h>
@@ -17,7 +18,6 @@
 #define MAP_SHARED_VALIDATE   0x0
 #endif /* CONFIG_LINUX */
 
-#include "qemu/osdep.h"
 #include "qemu/mmap-alloc.h"
 #include "qemu/host-utils.h"
 #include "qemu/cutils.h"
-- 
2.37.3
Re: [PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c
Posted by Juan Quintela 3 years ago
Peter Xu <peterx@redhat.com> wrote:
> Without it, we never have CONFIG_LINUX defined even if on linux, so
> linux/mman.h is never really included.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>

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

Markus is working on this right now, Markus?
Re: [PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c
Posted by Philippe Mathieu-Daudé 3 years ago
On 17/1/23 23:08, Peter Xu wrote:
> Without it, we never have CONFIG_LINUX defined even if on linux, so
> linux/mman.h is never really included.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>   util/mmap-alloc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH RFC 02/21] util: Include osdep.h first in util/mmap-alloc.c
Posted by Dr. David Alan Gilbert 3 years ago
* Peter Xu (peterx@redhat.com) wrote:
> Without it, we never have CONFIG_LINUX defined even if on linux, so
> linux/mman.h is never really included.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  util/mmap-alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
> index 5ed7d29183..040599b0e3 100644
> --- a/util/mmap-alloc.c
> +++ b/util/mmap-alloc.c
> @@ -9,6 +9,7 @@
>   * This work is licensed under the terms of the GNU GPL, version 2 or
>   * later.  See the COPYING file in the top-level directory.
>   */
> +#include "qemu/osdep.h"
>  
>  #ifdef CONFIG_LINUX
>  #include <linux/mman.h>
> @@ -17,7 +18,6 @@
>  #define MAP_SHARED_VALIDATE   0x0
>  #endif /* CONFIG_LINUX */
>  
> -#include "qemu/osdep.h"
>  #include "qemu/mmap-alloc.h"
>  #include "qemu/host-utils.h"
>  #include "qemu/cutils.h"
> -- 
> 2.37.3
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK