|
From: | Eric Blake |
Subject: | Re: [PATCH v6 02/12] monitor: Use getter/setter functions for cur_mon |
Date: | Thu, 28 May 2020 13:31:36 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
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 <kwolf@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
[Prev in Thread] | Current Thread | [Next in Thread] |