[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/11] exec: Restrict ramblock.h to sysemu/
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 10/11] exec: Restrict ramblock.h to sysemu/ |
Date: |
Mon, 17 May 2021 13:11:10 +0200 |
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é <f4bug@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
- [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu), Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 01/11] NOTFORMERGE target/arm: Restrict KVM files to softmmu, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 02/11] exec: Restrict hwaddr.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 03/11] exec: Restrict cputlb.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 04/11] exec: Restrict memory.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 05/11] exec: Restrict memory-internal.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 07/11] exec: Extract CPU I/O instructions to "cpu-io.h", Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 06/11] exec: Restrict address-spaces.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 08/11] exec: Restrict ioport.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 09/11] exec: Restrict ram_addr.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- [PATCH 10/11] exec: Restrict ramblock.h to sysemu/,
Philippe Mathieu-Daudé <=
- [PATCH 11/11] exec: Restrict confidential-guest-support.h to sysemu/, Philippe Mathieu-Daudé, 2021/05/17
- Re: [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu), Philippe Mathieu-Daudé, 2021/05/25