[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 05/20] block/block-copy: implement block_copy_async
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 05/20] block/block-copy: implement block_copy_async |
Date: |
Tue, 21 Jul 2020 10:43:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 17.07.20 17:24, Vladimir Sementsov-Ogievskiy wrote:
> 17.07.2020 17:00, Max Reitz wrote:
>> On 01.06.20 20:11, Vladimir Sementsov-Ogievskiy wrote:
>>> We'll need async block-copy invocation to use in backup directly.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> ---
>>> include/block/block-copy.h | 13 +++++++++++++
>>> block/block-copy.c | 40 ++++++++++++++++++++++++++++++++++++++
>>> 2 files changed, 53 insertions(+)
[...]
>>> +BlockCopyCallState *block_copy_async(BlockCopyState *s,
>>> + int64_t offset, int64_t bytes,
>>> + bool ratelimit, int max_workers,
>>> + int64_t max_chunk,
>>> + BlockCopyAsyncCallbackFunc cb)
>>> +{
>>> + BlockCopyCallState *call_state = g_new(BlockCopyCallState, 1);
>>> + Coroutine *co = qemu_coroutine_create(block_copy_async_co_entry,
>>> + call_state);
>>> +
>>> + *call_state = (BlockCopyCallState) {
>>> + .s = s,
>>> + .offset = offset,
>>> + .bytes = bytes,
>>> + .cb = cb,
>>> + };
>>> +
>>> + qemu_coroutine_enter(co);
>>
>> Do we need/want any already-in-coroutine shenanigans here?
>>
>
> No: the aim of the function is to start a new coroutine in parallel,
> independently of are we already in some other coroutine or not.
OK, that makes sense.
signature.asc
Description: OpenPGP digital signature