Skip to content

Commit fd5fc4b

Browse files
committed
remove qemu-options* from root directory
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 75eebe0 commit fd5fc4b

File tree

6 files changed

+31
-49
lines changed

6 files changed

+31
-49
lines changed

qemu-options.h renamed to include/qemu/qemu-options.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
#define QEMU_OPTIONS_H
3030

3131
enum {
32-
#define QEMU_OPTIONS_GENERATE_ENUM
33-
#include "qemu-options-wrapper.h"
32+
33+
#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
34+
opt_enum,
35+
#define DEFHEADING(text)
36+
#define ARCHHEADING(text, arch_mask)
37+
38+
#include "qemu-options.def"
3439
};
3540

3641
#endif

os-posix.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "qemu-common.h"
3333
/* Needed early for CONFIG_BSD etc. */
3434
#include "net/slirp.h"
35-
#include "qemu-options.h"
35+
#include "qemu/qemu-options.h"
3636
#include "qemu/error-report.h"
3737
#include "qemu/log.h"
3838
#include "sysemu/runstate.h"

os-win32.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <windows.h>
2828
#include <mmsystem.h>
2929
#include "qemu-common.h"
30-
#include "qemu-options.h"
3130
#include "sysemu/runstate.h"
3231

3332
static BOOL WINAPI qemu_ctrl_handler(DWORD type)

qemu-options-wrapper.h

-40
This file was deleted.

qemu-options.hx

+4
Original file line numberDiff line numberDiff line change
@@ -5276,3 +5276,7 @@ ERST
52765276

52775277

52785278
HXCOMM This is the last statement. Insert new options before this line!
5279+
5280+
#undef DEF
5281+
#undef DEFHEADING
5282+
#undef ARCHHEADING

softmmu/vl.c

+19-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#include "qapi/qobject-input-visitor.h"
8989
#include "qemu/option.h"
9090
#include "qemu/config-file.h"
91-
#include "qemu-options.h"
91+
#include "qemu/qemu-options.h"
9292
#include "qemu/main-loop.h"
9393
#ifdef CONFIG_VIRTFS
9494
#include "fsdev/qemu-fsdev.h"
@@ -854,8 +854,17 @@ static void help(int exitcode)
854854
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
855855
error_get_progname());
856856

857-
#define QEMU_OPTIONS_GENERATE_HELP
858-
#include "qemu-options-wrapper.h"
857+
#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
858+
if ((arch_mask) & arch_type) \
859+
fputs(opt_help, stdout);
860+
861+
#define ARCHHEADING(text, arch_mask) \
862+
if ((arch_mask) & arch_type) \
863+
puts(stringify(text));
864+
865+
#define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL)
866+
867+
#include "qemu-options.def"
859868

860869
printf("\nDuring emulation, the following keys are useful:\n"
861870
"ctrl-alt-f toggle full screen\n"
@@ -880,8 +889,13 @@ typedef struct QEMUOption {
880889

881890
static const QEMUOption qemu_options[] = {
882891
{ "h", 0, QEMU_OPTION_h, QEMU_ARCH_ALL },
883-
#define QEMU_OPTIONS_GENERATE_OPTIONS
884-
#include "qemu-options-wrapper.h"
892+
893+
#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \
894+
{ option, opt_arg, opt_enum, arch_mask },
895+
#define DEFHEADING(text)
896+
#define ARCHHEADING(text, arch_mask)
897+
898+
#include "qemu-options.def"
885899
{ NULL },
886900
};
887901

0 commit comments

Comments
 (0)