qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/7] block-copy: add QemuMutex lock for BlockCopyCallState


From: Paolo Bonzini
Subject: Re: [PATCH v2 5/7] block-copy: add QemuMutex lock for BlockCopyCallState list
Date: Fri, 21 May 2021 17:01:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 20/05/21 17:30, Vladimir Sementsov-Ogievskiy wrote:
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote:
As for BlockCopyTask, add a lock to protect BlockCopyCallState
ret and sleep_state fields. Also move ret, finished and cancelled
in the OUT fields of BlockCopyCallState.

Here a QemuMutex is used to protect QemuCoSleep field, since it
can be concurrently invoked also from outside threads.

.finished, .cancelled and reads to .ret and .error_is_read will be
protected in the following patch.

.sleep state is handled in the series "coroutine: new sleep/wake API"

Could we live with one mutex for all needs? Why to add one more?

This patch should just go away; the QemuMutex will not be needed once QemuCoSleep is thread safe, while right now it is still racy.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]