{
sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
-e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
- -e '/main-loop: WARNING: I\/O thread spun for [0-9]\+ iterations/d' \
-e $'s#\r##' # QEMU monitor uses \r\n line endings
}
{
GMainContext *context = g_main_context_default();
int ret;
- static int spin_counter;
g_main_context_acquire(context);
glib_pollfds_fill(&timeout);
- /* If the I/O thread is very busy or we are incorrectly busy waiting in
- * the I/O thread, this can lead to starvation of the BQL such that the
- * VCPU threads never run. To make sure we can detect the later case,
- * print a message to the screen. If we run into this condition, create
- * a fake timeout in order to give the VCPU threads a chance to run.
- */
- if (!timeout && (spin_counter > MAX_MAIN_LOOP_SPIN)) {
- static bool notified;
-
- if (!notified && !qtest_enabled() && !qtest_driver()) {
- warn_report("I/O thread spun for %d iterations",
- MAX_MAIN_LOOP_SPIN);
- notified = true;
- }
-
- timeout = SCALE_MS;
- }
-
-
- if (timeout) {
- spin_counter = 0;
- } else {
- spin_counter++;
- }
qemu_mutex_unlock_iothread();
replay_mutex_unlock();