On 5/28/20 10:37 AM, Kevin Wolf wrote:
cur_mon really needs to be coroutine-local as soon as we move monitor
command handlers to coroutines and let them yield. As a first step, just
remove all direct accesses to cur_mon so that we can implement this in
the getter function later.
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
+++ b/audio/wavcapture.c
@@ -1,5 +1,5 @@
#include "qemu/osdep.h"
-#include "monitor/monitor.h"
+#include "qemu/qemu-print.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "audio.h"
@@ -94,9 +94,9 @@ static void wav_capture_info (void *opaque)
WAVState *wav = opaque;
char *path = wav->path;
- monitor_printf (cur_mon, "Capturing audio(%d,%d,%d) to %s: %d bytes\n",
- wav->freq, wav->bits, wav->nchannels,
- path ? path : "<not available>", wav->bytes);
+ qemu_printf("Capturing audio(%d,%d,%d) to %s: %d bytes\n",
+ wav->freq, wav->bits, wav->nchannels,
+ path ? path : "<not available>", wav->bytes);
Why the change to qemu_printf() here instead of a call to monitor_cur()
as is done in the rest of the patch?
+++ b/stubs/monitor-core.c
@@ -3,7 +3,10 @@
#include "qemu-common.h"
#include "qapi/qapi-emit-events.h"
-__thread Monitor *cur_mon;
+Monitor *monitor_cur(void)
+{
+ return NULL;
+}
monitor_set_cur() didn't need a stub? Odd, but I guess it's okay.
Otherwise the patch looks fine to me.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org