char *buf, int buf_size)
{
int i;
+ int old_focus[MAX_MON];
if (is_password) {
- for (i = 0; i < MAX_MON; i++)
- if (monitor_hd[i] && monitor_hd[i]->focus == 0)
+ for (i = 0; i < MAX_MON; i++) {
+ old_focus[i] = 0;
+ if (monitor_hd[i]) {
+ old_focus[i] = monitor_hd[i]->focus;
+ monitor_hd[i]->focus = 0;
qemu_chr_send_event(monitor_hd[i], CHR_EVENT_FOCUS);
+ }
+ }
}
+
readline_start(prompt, is_password, monitor_readline_cb, NULL);
monitor_readline_buf = buf;
monitor_readline_buf_size = buf_size;
while (monitor_readline_started) {
main_loop_wait(10);
}
+ /* restore original focus */
+ if (is_password) {
+ for (i = 0; i < MAX_MON; i++)
+ if (old_focus[i])
+ monitor_hd[i]->focus = old_focus[i];
+ }
}
}
break;
case QEMU_OPTION_nographic:
- serial_devices[0] = "stdio";
- parallel_devices[0] = "null";
- monitor_device = "stdio";
nographic = 1;
break;
#ifdef CONFIG_CURSES
}
}
+ if (nographic) {
+ if (serial_device_index == 0)
+ serial_devices[0] = "stdio";
+ if (parallel_device_index == 0)
+ parallel_devices[0] = "null";
+ if (strncmp(monitor_device, "vc", 2) == 0)
+ monitor_device = "stdio";
+ }
+
#ifndef _WIN32
if (daemonize) {
pid_t pid;