main-loop: Fix QEMU serial debugging on Windows

This commit is contained in:
gaasedelen 2022-08-05 14:14:23 -04:00 committed by GitHub
parent c2031108c5
commit 940bee452c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -110,7 +110,7 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp)
size = sizeof(COMMCONFIG);
GetDefaultCommConfig(filename, &comcfg, &size);
comcfg.dcb.DCBlength = sizeof(DCB);
CommConfigDialog(filename, NULL, &comcfg);
comcfg.dcb.BaudRate = CBR_115200;
if (!SetCommState(s->file, &comcfg.dcb)) {
error_setg(errp, "Failed SetCommState");

View File

@ -490,16 +490,6 @@ static int os_host_main_loop_wait(int64_t timeout)
g_main_context_acquire(context);
/* XXX: need to suppress polling by better using win32 events */
ret = 0;
for (pe = first_polling_entry; pe != NULL; pe = pe->next) {
ret |= pe->func(pe->opaque);
}
if (ret != 0) {
g_main_context_release(context);
return ret;
}
FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_ZERO(&xfds);
@ -562,7 +552,17 @@ static int os_host_main_loop_wait(int64_t timeout)
g_main_context_dispatch(context);
}
/* XXX: need to suppress polling by better using win32 events */
ret = 0;
for (pe = first_polling_entry; pe != NULL; pe = pe->next) {
ret |= pe->func(pe->opaque);
}
g_main_context_release(context);
if (ret != 0) {
return ret;
}
return select_ret || g_poll_ret;
}