To make it clearer the ramblock.h header is sysemu specific,
move it to the sysemu/ directory.

Patch created mechanically using:

  $ sed -i s,exec/ramblock.h,sysemu/ramblock.h, $(git grep -l exec/ramblock.h)

Then the #ifdef'ry conditional on CONFIG_USER_ONLY has
been replaced by an #error.

Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
---
 include/sysemu/ram_addr.h           |  2 +-
 include/{exec => sysemu}/ramblock.h | 13 ++++++++-----
 migration/dirtyrate.c               |  2 +-
 migration/multifd.c                 |  2 +-
 migration/postcopy-ram.c            |  2 +-
 tests/qtest/fuzz/generic_fuzz.c     |  2 +-
 MAINTAINERS                         |  2 +-
 7 files changed, 14 insertions(+), 11 deletions(-)
 rename include/{exec => sysemu}/ramblock.h (92%)

diff --git a/include/sysemu/ram_addr.h b/include/sysemu/ram_addr.h
index d495c969f9f..aea30dfeb4e 100644
--- a/include/sysemu/ram_addr.h
+++ b/include/sysemu/ram_addr.h
@@ -27,7 +27,7 @@
 #include "sysemu/xen.h"
 #include "sysemu/tcg.h"
 #include "exec/ramlist.h"
-#include "exec/ramblock.h"
+#include "sysemu/ramblock.h"
 
 /**
  * clear_bmap_size: calculate clear bitmap size
diff --git a/include/exec/ramblock.h b/include/sysemu/ramblock.h
similarity index 92%
rename from include/exec/ramblock.h
rename to include/sysemu/ramblock.h
index 664701b7594..12a1b90a19b 100644
--- a/include/exec/ramblock.h
+++ b/include/sysemu/ramblock.h
@@ -16,11 +16,14 @@
  * The functions declared here will be removed soon.
  */
 
-#ifndef QEMU_EXEC_RAMBLOCK_H
-#define QEMU_EXEC_RAMBLOCK_H
+#ifndef QEMU_SYSEMU_RAMBLOCK_H
+#define QEMU_SYSEMU_RAMBLOCK_H
 
-#ifndef CONFIG_USER_ONLY
-#include "cpu-common.h"
+#ifdef CONFIG_USER_ONLY
+#error Cannot include sysemu specific header from user emulation
+#endif
+
+#include "exec/cpu-common.h"
 
 struct RAMBlock {
     struct rcu_head rcu;
@@ -70,5 +73,5 @@ struct RAMBlock {
      */
     ram_addr_t postcopy_length;
 };
-#endif
+
 #endif
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index ccb98147e89..5422b39784f 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -14,7 +14,7 @@
 #include <zlib.h>
 #include "qapi/error.h"
 #include "cpu.h"
-#include "exec/ramblock.h"
+#include "sysemu/ramblock.h"
 #include "qemu/rcu_queue.h"
 #include "qapi/qapi-commands-migration.h"
 #include "ram.h"
diff --git a/migration/multifd.c b/migration/multifd.c
index 0a4803cfccb..519f8dd4393 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -14,7 +14,7 @@
 #include "qemu/rcu.h"
 #include "exec/target_page.h"
 #include "sysemu/sysemu.h"
-#include "exec/ramblock.h"
+#include "sysemu/ramblock.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "ram.h"
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 2e9697bdd2e..fb8c625ffc3 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -31,7 +31,7 @@
 #include "qemu/error-report.h"
 #include "trace.h"
 #include "hw/boards.h"
-#include "exec/ramblock.h"
+#include "sysemu/ramblock.h"
 
 /* Arbitrary limit on size of each discard command,
  * keeps them around ~200 bytes
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
index 05f9c9b06f9..613427f1a57 100644
--- a/tests/qtest/fuzz/generic_fuzz.c
+++ b/tests/qtest/fuzz/generic_fuzz.c
@@ -21,7 +21,7 @@
 #include "fork_fuzz.h"
 #include "string.h"
 #include "exec/sysemu/memory.h"
-#include "exec/ramblock.h"
+#include "sysemu/ramblock.h"
 #include "hw/qdev-core.h"
 #include "hw/pci/pci.h"
 #include "hw/boards.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index 8caf3891dba..cea4f2e438a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2402,7 +2402,7 @@ F: include/sysemu/ioport.h
 F: include/exec/memop.h
 F: include/exec/sysemu/memory.h
 F: include/sysemu/ram_addr.h
-F: include/exec/ramblock.h
+F: include/sysemu/ramblock.h
 F: softmmu/dma-helpers.c
 F: softmmu/ioport.c
 F: softmmu/memory.c
-- 
2.26.3


Reply via email to