From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: [PULL 22/26] remove qemu-options* from root directory
Date: Thu, 20 May 2021 10:22:53 +0200 [thread overview]
Message-ID: <20210520082257.187061-23-pbonzini@redhat.com> (raw)
In-Reply-To: <20210520082257.187061-1-pbonzini@redhat.com>
These headers are also included from softmmu/vl.c, so they should be
in include/. Remove qemu-options-wrapper.h, since elsewhere
we include "template" headers directly and #define the parameters in
the including file; move qemu-options.h to include/.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
qemu-options.h => include/qemu/qemu-options.h | 9 ++++-
os-posix.c | 2 +-
os-win32.c | 1 -
qemu-options-wrapper.h | 40 -------------------
qemu-options.hx | 4 ++
softmmu/vl.c | 24 ++++++++---
6 files changed, 31 insertions(+), 49 deletions(-)
rename qemu-options.h => include/qemu/qemu-options.h (88%)
delete mode 100644 qemu-options-wrapper.h
diff --git a/qemu-options.h b/include/qemu/qemu-options.h
similarity index 88%
rename from qemu-options.h
rename to include/qemu/qemu-options.h
index b4ee63cd60..4a62c83c45 100644
--- a/qemu-options.h
+++ b/include/qemu/qemu-options.h
@@ -29,8 +29,13 @@
#define QEMU_OPTIONS_H
enum {
-#define QEMU_OPTIONS_GENERATE_ENUM
-#include "qemu-options-wrapper.h"
+
+#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
+ opt_enum,
+#define DEFHEADING(text)
+#define ARCHHEADING(text, arch_mask)
+
+#include "qemu-options.def"
};
#endif
diff --git a/os-posix.c b/os-posix.c
index a6846f51c1..ae6c9f2a5e 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -32,7 +32,7 @@
#include "qemu-common.h"
/* Needed early for CONFIG_BSD etc. */
#include "net/slirp.h"
-#include "qemu-options.h"
+#include "qemu/qemu-options.h"
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "sysemu/runstate.h"
diff --git a/os-win32.c b/os-win32.c
index fd1137bab1..e31c921983 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -27,7 +27,6 @@
#include <windows.h>
#include <mmsystem.h>
#include "qemu-common.h"
-#include "qemu-options.h"
#include "sysemu/runstate.h"
static BOOL WINAPI qemu_ctrl_handler(DWORD type)
diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h
deleted file mode 100644
index 6f548e3922..0000000000
--- a/qemu-options-wrapper.h
+++ /dev/null
@@ -1,40 +0,0 @@
-
-#if defined(QEMU_OPTIONS_GENERATE_ENUM)
-
-#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
- opt_enum,
-#define DEFHEADING(text)
-#define ARCHHEADING(text, arch_mask)
-
-#elif defined(QEMU_OPTIONS_GENERATE_HELP)
-
-#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
- if ((arch_mask) & arch_type) \
- fputs(opt_help, stdout);
-
-#define ARCHHEADING(text, arch_mask) \
- if ((arch_mask) & arch_type) \
- puts(stringify(text));
-
-#define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL)
-
-#elif defined(QEMU_OPTIONS_GENERATE_OPTIONS)
-
-#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
- { option, opt_arg, opt_enum, arch_mask },
-#define DEFHEADING(text)
-#define ARCHHEADING(text, arch_mask)
-
-#else
-#error "qemu-options-wrapper.h included with no option defined"
-#endif
-
-#include "qemu-options.def"
-
-#undef DEF
-#undef DEFHEADING
-#undef ARCHHEADING
-
-#undef QEMU_OPTIONS_GENERATE_ENUM
-#undef QEMU_OPTIONS_GENERATE_HELP
-#undef QEMU_OPTIONS_GENERATE_OPTIONS
diff --git a/qemu-options.hx b/qemu-options.hx
index ecdb064409..8116f79818 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -5276,3 +5276,7 @@ ERST
HXCOMM This is the last statement. Insert new options before this line!
+
+#undef DEF
+#undef DEFHEADING
+#undef ARCHHEADING
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 11ac3750d8..ac0ff6e160 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -88,7 +88,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
-#include "qemu-options.h"
+#include "qemu/qemu-options.h"
#include "qemu/main-loop.h"
#ifdef CONFIG_VIRTFS
#include "fsdev/qemu-fsdev.h"
@@ -854,8 +854,17 @@ static void help(int exitcode)
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
error_get_progname());
-#define QEMU_OPTIONS_GENERATE_HELP
-#include "qemu-options-wrapper.h"
+#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
+ if ((arch_mask) & arch_type) \
+ fputs(opt_help, stdout);
+
+#define ARCHHEADING(text, arch_mask) \
+ if ((arch_mask) & arch_type) \
+ puts(stringify(text));
+
+#define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL)
+
+#include "qemu-options.def"
printf("\nDuring emulation, the following keys are useful:\n"
"ctrl-alt-f toggle full screen\n"
@@ -880,8 +889,13 @@ typedef struct QEMUOption {
static const QEMUOption qemu_options[] = {
{ "h", 0, QEMU_OPTION_h, QEMU_ARCH_ALL },
-#define QEMU_OPTIONS_GENERATE_OPTIONS
-#include "qemu-options-wrapper.h"
+
+#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
+ { option, opt_arg, opt_enum, arch_mask },
+#define DEFHEADING(text)
+#define ARCHHEADING(text, arch_mask)
+
+#include "qemu-options.def"
{ NULL },
};
--
2.31.1
next prev parent reply other threads:[~2021-05-20 8:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 8:22 [PULL 00/26] Misc patches for 2021-05-20 Paolo Bonzini
2021-05-20 8:22 ` [PULL 01/26] configure: Only clone softfloat-3 repositories if TCG is enabled Paolo Bonzini
2021-05-20 8:22 ` [PULL 02/26] configure: check for submodules if --with-git-submodules=ignore Paolo Bonzini
2021-05-20 8:22 ` [PULL 03/26] configure: simplify assignment to GIT_SUBMODULES Paolo Bonzini
2021-05-20 8:22 ` [PULL 04/26] hw/mem/nvdimm: Use Kconfig 'imply' instead of 'depends on' Paolo Bonzini
2021-05-20 8:22 ` [PULL 05/26] i386/cpu: Expose AVX_VNNI instruction to guest Paolo Bonzini
2021-05-20 8:22 ` [PULL 06/26] meson: bump submodule to 0.57.2 Paolo Bonzini
2021-05-20 8:22 ` [PULL 07/26] object: add more commands to preconfig mode Paolo Bonzini
2021-05-20 8:22 ` [PULL 08/26] qtest: add a QOM object for qtest Paolo Bonzini
2021-05-20 8:22 ` [PULL 09/26] KVM: do not allow setting properties at runtime Paolo Bonzini
2021-05-20 8:22 ` [PULL 10/26] memory: Introduce log_sync_global() to memory listener Paolo Bonzini
2021-05-20 8:22 ` [PULL 11/26] KVM: Use a big lock to replace per-kml slots_lock Paolo Bonzini
2021-05-20 8:22 ` [PULL 12/26] KVM: Create the KVMSlot dirty bitmap on flag changes Paolo Bonzini
2021-05-20 8:22 ` [PULL 13/26] KVM: Provide helper to get kvm dirty log Paolo Bonzini
2021-05-20 8:22 ` [PULL 14/26] KVM: Provide helper to sync dirty bitmap from slot to ramblock Paolo Bonzini
2021-05-20 8:22 ` [PULL 15/26] KVM: Simplify dirty log sync in kvm_set_phys_mem Paolo Bonzini
2021-05-20 8:22 ` [PULL 16/26] KVM: Cache kvm slot dirty bitmap size Paolo Bonzini
2021-05-20 8:22 ` [PULL 17/26] KVM: Add dirty-ring-size property Paolo Bonzini
2021-05-20 8:22 ` [PULL 18/26] KVM: Disable manual dirty log when dirty ring enabled Paolo Bonzini
2021-05-20 8:22 ` [PULL 19/26] KVM: Dirty ring support Paolo Bonzini
2021-05-20 8:22 ` [PULL 20/26] tests/qtest/fuzz: Fix build failure Paolo Bonzini
2021-05-20 8:22 ` [PULL 21/26] meson: Set implicit_include_directories to false Paolo Bonzini
2021-05-20 8:22 ` Paolo Bonzini [this message]
2021-05-20 8:22 ` [PULL 23/26] replication: move include out of root directory Paolo Bonzini
2021-05-20 8:22 ` [PULL 24/26] vl: allow not specifying size in -m when using -M memory-backend Paolo Bonzini
2021-05-20 8:22 ` [PULL 25/26] qemu-config: load modules when instantiating option groups Paolo Bonzini
2021-05-20 8:22 ` [PULL 26/26] scsi-generic: pass max_segments via max_iov field in BlockLimits Paolo Bonzini
2021-05-20 8:54 ` [PULL 00/26] Misc patches for 2021-05-20 no-reply
2021-05-20 13:26 ` Peter Maydell
2021-05-20 14:20 ` Peter Maydell
2021-05-20 14:25 ` Peter Maydell
2021-05-21 13:27 ` Paolo Bonzini
2021-05-21 13:44 ` Peter Maydell
2021-05-24 9:42 ` Paolo Bonzini
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=20210520082257.187061-23-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).