All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: [PATCH 10/11] exec: Restrict ramblock.h to sysemu/
Date: Mon, 17 May 2021 13:11:10 +0200	[thread overview]
Message-ID: <20210517111111.1068153-11-f4bug@amsat.org> (raw)
In-Reply-To: <20210517111111.1068153-1-f4bug@amsat.org>

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



  parent reply	other threads:[~2021-05-17 11:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 11:11 [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 01/11] NOTFORMERGE target/arm: Restrict KVM files to softmmu Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 02/11] exec: Restrict hwaddr.h to sysemu/ Philippe Mathieu-Daudé
2021-05-26 18:15   ` Richard Henderson
2022-12-06 14:32     ` Philippe Mathieu-Daudé
2022-12-06 14:40       ` Philippe Mathieu-Daudé
2022-12-06 14:53   ` Claudio Fontana
2022-12-06 15:38     ` Claudio Fontana
2022-12-06 17:09       ` Philippe Mathieu-Daudé
2022-12-06 17:17         ` Richard Henderson
2022-12-07 10:09         ` Claudio Fontana
2022-12-06 15:01   ` Peter Maydell
2021-05-17 11:11 ` [PATCH 03/11] exec: Restrict cputlb.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 04/11] exec: Restrict memory.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 05/11] exec: Restrict memory-internal.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 06/11] exec: Restrict address-spaces.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 07/11] exec: Extract CPU I/O instructions to "cpu-io.h" Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 08/11] exec: Restrict ioport.h to sysemu/ Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 09/11] exec: Restrict ram_addr.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` Philippe Mathieu-Daudé [this message]
2021-05-17 11:11 ` [PATCH 11/11] exec: Restrict confidential-guest-support.h " Philippe Mathieu-Daudé
2021-05-25 14:13 ` [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-11-06 14:58   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210517111111.1068153-11-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=cfontana@suse.de \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.