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

2021-05-28 Thread Paolo Bonzini
On 18/05/21 12:07, Emanuele Giuseppe Esposito wrote: +qemu_mutex_lock(&call_state->s->calls_lock); QLIST_INSERT_HEAD(&call_state->s->calls, call_state, list); +qemu_mutex_unlock(&call_state->s->calls_lock); Let's just use tasks_lock here (maybe even rename it to just "lock"). Pao

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

2021-05-26 Thread Paolo Bonzini
On 25/05/21 12:58, Emanuele Giuseppe Esposito wrote: At this point, I would just rename the other lock (tasks_lock) in "lock" or "state_lock", and substitute it in the calls_lock usages of this patch. Depending on how it comes out, I may merge this with the previous patch. Renaming the lock

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

2021-05-25 Thread Emanuele Giuseppe Esposito
On 21/05/2021 17:01, Paolo Bonzini wrote: 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 fie

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

2021-05-21 Thread Paolo Bonzini
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 i

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

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
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 con

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

2021-05-18 Thread Emanuele Giuseppe Esposito
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. .finishe