Skip to contentSkip to conversation

memory_mapping: Use qemu_common.h include

PATCH In review Peter Crosthwaite 3 participants 5 messages May 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory_mapping: Use qemu_common.h include

Rather than an explicit inclusion of cpu.h. This maked it more consistent with other core code files, which either just rely on qemu-common.h inclusion or preceed cpu.h with qemu-common.h anyway.

---
Picked up by my multi arch WIP where target-multi/cpu.h cant handle random core code inclusion without preceeded qemu-common.h. I guess this is the only one in tree?

---
 memory_mapping.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
memory_mapping.c +1 -2
index 7b69801..7cf5548 100644
@@ -13,8 +13,7 @@
 
 #include <glib.h>
 
-#include "cpu.h"
-#include "exec/cpu-all.h"
+#include "qemu-common.h"
 #include "sysemu/memory_mapping.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · Peter Crosthwaite

Rather than an explicit inclusion of cpu.h. This maked it more consistent with other core code files, which either just rely on qemu-common.h inclusion or preceed cpu.h with qemu-common.h anyway.

I'd rather keep the cpu.h inclusion. It would be nice to get rid of the automagic inclusion of cpu.h from qemu-common.h.

Paolo

Quoted 24 lines

---
Picked up by my multi arch WIP where target-multi/cpu.h cant handle random core code inclusion without preceeded qemu-common.h. I guess this is the only one in tree?

---
 memory_mapping.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
memory_mapping.c +1 -3
index 7b69801..7cf5548 100644
@@ -13,8 +13,7 @@
 
 #include <glib.h>
 
-#include "cpu.h"
-#include "exec/cpu-all.h"
+#include "qemu-common.h"
 #include "sysemu/memory_mapping.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
-- 1.9.1
#2 lore raw
Quoted 10 lines · Paolo Bonzini
Quoted 3 lines · Peter Crosthwaite

Rather than an explicit inclusion of cpu.h. This maked it more consistent with other core code files, which either just rely on qemu-common.h inclusion or preceed cpu.h with qemu-common.h anyway.

I'd rather keep the cpu.h inclusion. It would be nice to get rid of the automagic inclusion of cpu.h from qemu-common.h.

OK, but it is an odd one out, would you be willing to accept the double include that seems to be widespread?

+#include "qemu_common.h"
#include "cpu.h"
-#include "exec/cpu-all.h"

Regards,
Peter

Quoted 27 lines

Paolo

Quoted 24 lines

---
Picked up by my multi arch WIP where target-multi/cpu.h cant handle random core code inclusion without preceeded qemu-common.h. I guess this is the only one in tree?

---
 memory_mapping.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
memory_mapping.c +1 -3
index 7b69801..7cf5548 100644
@@ -13,8 +13,7 @@
 
 #include <glib.h>
 
-#include "cpu.h"
-#include "exec/cpu-all.h"
+#include "qemu-common.h"
 #include "sysemu/memory_mapping.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
-- 1.9.1
#3 lore raw

Review

Quoted 6 lines · Peter Crosthwaite

OK, but it is an odd one out, would you be willing to accept the double include that seems to be widespread?

(quoted diff) +1 -1
+#include "qemu_common.h"
 #include "cpu.h"
-#include "exec/cpu-all.h"

This is exactly what I meant. What is odd about it?

In fact, including exec/cpu-all.h outside cpu.h is definitely odd.

Paolo

#4 lore raw
Quoted 12 lines · Paolo Bonzini

Review

Quoted 6 lines · Peter Crosthwaite

OK, but it is an odd one out, would you be willing to accept the double include that seems to be widespread?

(quoted diff) +1 -1
+#include "qemu_common.h"
 #include "cpu.h"
-#include "exec/cpu-all.h"

This is exactly what I meant. What is odd about it?

Nothing at all. It's just the other of the two valid resolutions to my problem. I lost the coinflip when I wrote the patch :) Will respin tonight.

Regards,
Peter

Quoted 4 lines

In fact, including exec/cpu-all.h outside cpu.h is definitely odd.

Paolo