On Mon, May 10, 2021 at 10:59:39AM +0200, Emanuele Giuseppe Esposito wrote: > Progressmeter is protected by the AioContext mutex, which > is taken by the block jobs and their caller (like blockdev). > > We would like to remove the dependency of block layer code on the > AioContext mutex, since most drivers and the core I/O code are already > not relying on it. > > The simplest thing to do is to add a mutex to be able to provide > an accurate snapshot of the progress values to the caller. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > blockjob.c | 33 +++++++++++++++++++++++++-------- > include/qemu/progress_meter.h | 31 +++++++++++++++++++++++++++++++ > job-qmp.c | 8 ++++++-- > job.c | 3 +++ > qemu-img.c | 9 ++++++--- > 5 files changed, 71 insertions(+), 13 deletions(-) Unlike the next two patches where I had comments, here adding the lock makes sense to me - the point of the progress meter is to report numbers to the monitor thread so thread-safety is a key part of the API's value. Reviewed-by: Stefan Hajnoczi