int fd_bootchk = 1;
static int no_reboot;
int no_shutdown = 0;
-int cursor_hide = 1;
int graphic_rotate = 0;
const char *watchdog;
QEMUOptionRom option_rom[MAX_OPTION_ROMS];
} else {
goto invalid_sdl_args;
}
+ } else if (strstart(opts, ",show-cursor=", &nextopt)) {
+ opts = nextopt;
+ dpy.has_show_cursor = true;
+ if (strstart(opts, "on", &nextopt)) {
+ dpy.show_cursor = true;
+ } else if (strstart(opts, "off", &nextopt)) {
+ dpy.show_cursor = false;
+ } else {
+ goto invalid_sdl_args;
+ }
} else if (strstart(opts, ",gl=", &nextopt)) {
opts = nextopt;
dpy.has_gl = true;
static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
- Chardev *chr;
- bool qmp;
- bool pretty = false;
- const char *chardev;
- const char *mode;
-
- mode = qemu_opt_get(opts, "mode");
- if (mode == NULL) {
- mode = "readline";
- }
- if (strcmp(mode, "readline") == 0) {
- qmp = false;
- } else if (strcmp(mode, "control") == 0) {
- qmp = true;
- } else {
- error_setg(errp, "unknown monitor mode \"%s\"", mode);
- return -1;
- }
-
- if (!qmp && qemu_opt_get(opts, "pretty")) {
- warn_report("'pretty' is deprecated for HMP monitors, it has no effect "
- "and will be removed in future versions");
- }
- if (qemu_opt_get_bool(opts, "pretty", 0)) {
- pretty = true;
- }
-
- chardev = qemu_opt_get(opts, "chardev");
- if (!chardev) {
- error_report("chardev is required");
- exit(1);
- }
- chr = qemu_chr_find(chardev);
- if (chr == NULL) {
- error_setg(errp, "chardev \"%s\" not found", chardev);
- return -1;
- }
-
- if (qmp) {
- monitor_init_qmp(chr, pretty);
- } else {
- monitor_init_hmp(chr, true);
- }
- return 0;
+ return monitor_init_opts(opts, errp);
}
static void monitor_parse(const char *optarg, const char *mode, bool pretty)
gchar **optname = g_strsplit(typename,
ACCEL_CLASS_SUFFIX, 0);
printf("%s\n", optname[0]);
- g_free(optname);
+ g_strfreev(optname);
}
g_free(typename);
}
no_shutdown = 1;
break;
case QEMU_OPTION_show_cursor:
- cursor_hide = 0;
+ warn_report("The -show-cursor option is deprecated, "
+ "use -display {sdl,gtk},show-cursor=on instead");
+ dpy.has_show_cursor = true;
+ dpy.show_cursor = true;
break;
case QEMU_OPTION_uuid:
if (qemu_uuid_parse(optarg, &qemu_uuid) < 0) {
/* Open the logfile at this point and set the log mask if necessary.
*/
- if (log_file) {
- qemu_set_log_filename(log_file, &error_fatal);
- }
-
+ qemu_set_log_filename(log_file, &error_fatal);
if (log_mask) {
int mask;
mask = qemu_str_to_log_mask(log_mask);