Skip to content

Commit

Permalink
remove qemu-options* from root directory
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini committed May 26, 2021
1 parent 75eebe0 commit fd5fc4b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 49 deletions.
9 changes: 7 additions & 2 deletions qemu-options.h → include/qemu/qemu-options.h
Expand Up @@ -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
2 changes: 1 addition & 1 deletion os-posix.c
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion os-win32.c
Expand Up @@ -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)
Expand Down
40 changes: 0 additions & 40 deletions qemu-options-wrapper.h

This file was deleted.

4 changes: 4 additions & 0 deletions qemu-options.hx
Expand Up @@ -5276,3 +5276,7 @@ ERST


HXCOMM This is the last statement. Insert new options before this line!

#undef DEF
#undef DEFHEADING
#undef ARCHHEADING
24 changes: 19 additions & 5 deletions softmmu/vl.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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 },
};

Expand Down

0 comments on commit fd5fc4b

Please sign in to comment.