Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> Don't assume specific parameter names like 'bs' or 'blk' in the
> generated code, but use the actual name.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
river callbacks for updating permissions and annotate the function
> pointers with GRAPH_RDLOCK_PTR.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
niently already hold the lock.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> The function reads the parents list, so it needs to hold the graph lock.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> The function reads the parents list, so it needs to hold the graph lock.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
y can't call functions that take it
> internally.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> Add a new wrapper type for GRAPH_WRLOCK functions that should be called
> from coroutine context.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> The documentation for bdrv_append() says that the caller must hold the
> AioContext lock for bs_top. Change all callers to actually adhere to the
> contract.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
in Wolf
Reviewed-by: Emanuele Giuseppe Esposito
y can't call functions that take it internally.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
t they can't call functions that take it
> internally.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> The function reads the parents list, so it needs to hold the graph lock.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> The function reads the parents list, so it needs to hold the graph lock.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
t they can't call functions that take it
> internally.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
e transaction
> callbacks can be changed, too.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> This field has been unused since commit 72373e40fbc ('block:
> bdrv_reopen_multiple: refresh permissions on updated graph').
> Remove it.
>
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Am 17/08/2023 um 14:50 schrieb Kevin Wolf:
> It's essentially the same code in preallocate_check_perm() and
> preallocate_close(), except that the latter ignores errors.
>
> Signed-off-by: Kevin Wolf
> ---
Reviewed-by: Emanuele Giuseppe Esposito
Ping?
Am 01/02/2023 um 14:57 schrieb Emanuele Giuseppe Esposito:
> QEMU should be able to show the guest the above feature/capability,
> otherwise we risk to have false vulnerability reports in the guest like in
> /sys/devices/system/cpu/vulnerabilities/mmio_stale_data
> because th
().
Fixes: b6903cbe3a2 "tests/unit/test-blockjob: Disable
complete_in_standby test"
Suggested-by: Hanna Czenczek
Signed-off-by: Emanuele Giuseppe Esposito
---
tests/unit/test-blockjob.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/tests/unit/test-bl
Am 26/04/2023 um 10:45 schrieb Thomas Huth:
> On 26/04/2023 10.16, Emanuele Giuseppe Esposito wrote:
>> Pause the job while draining so that pause_count will be
>> increased and bdrv_drain_all_end() won't reset it to 0, so the
>> job will not continue.
>>
>> Wit
Am 26/04/2023 um 10:03 schrieb Hanna Czenczek:
> On 26.04.23 09:38, Emanuele Giuseppe Esposito wrote:
>>
>> Am 25/04/2023 um 18:48 schrieb Hanna Czenczek:
>>> On 24.04.23 20:32, Vladimir Sementsov-Ogievskiy wrote:
>>>> On 24.04.23 16:36, Emanuele Giuseppe
().
Fixes: b6903cbe3a2 "tests/unit/test-blockjob: Disable
complete_in_standby test"
Suggested-by: Hanna Czenczek
Signed-off-by: Emanuele Giuseppe Esposito
---
tests/unit/test-blockjob.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/tests/unit/test-bl
Am 25/04/2023 um 18:48 schrieb Hanna Czenczek:
> On 24.04.23 20:32, Vladimir Sementsov-Ogievskiy wrote:
>> On 24.04.23 16:36, Emanuele Giuseppe Esposito wrote:
>>>
>>>
>>> Am 21/04/2023 um 12:13 schrieb Vladimir Sementsov-Ogievskiy:
>>>> On 17.03.
――
>>>
>>> Anybody in the block team looking at these, or shall we just
>>> disable this test entirely ?
>>
>> I ran into this issue today, too:
>>
>> https://gitlab.com/t
AIO_WAIT_WHILE(),
> which crashes if the aio_context lock is not taken before.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615
> Signed-off-by: Wang Liang
>
Thanks!
Reviewed-by: Emanuele Giuseppe Esposito
Am 24/04/2023 um 10:15 schrieb Emanuele Giuseppe Esposito:
>
>
> Am 23/04/2023 um 13:02 schrieb wanglian...@126.com:
>> From: Wang Liang
>>
>> We need to get the aio_context before calling the blk_is_available.
>>
>> Resolves: https://gitlab.com/qemu-p
Am 23/04/2023 um 13:02 schrieb wanglian...@126.com:
> From: Wang Liang
>
> We need to get the aio_context before calling the blk_is_available.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615
> Signed-off-by: Wang Liang
>
Reviewed-by: Emanuele Giuseppe Esposito
> Document that the AioContext lock should not be held across
> aio_wait_bh_oneshot(). Holding a lock across aio_poll() can cause
> deadlock so we don't want callers to do that.
>
> This is a step towards getting rid of the AioContext lock.
>
> Cc: Paolo Bonzini
> Signed-off-by: Stefa
> it).
>
> Fixes: 8ab8140a04cf771d63e9754d6ba6c1e676bfe507
> Reported-by: Lukáš Doktor
> Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
> ---
> include/block/block-io.h | 4 +++-
> include/sysemu/block-backend-io.h | 5 -
> block.c
back theme), are ready and their number looks
> manageable. You will still see some FIXMEs at the end of the series
> that will only be addressed in future patches.
Reviewed-by: Emanuele Giuseppe Esposito
>
> Emanuele Giuseppe Esposito (5):
> block/qed: add missing graph rdlock
thread and is not protected by
any lock.
Replace it with raw_co_getlength, that doesn't create a coroutine and
doesn't read the BDS graph.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/file-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/file-posix.c b
handle_aiocb_write_zeroes() should not
use bdrv_getlength() but rather raw_co_getlength().
Could you try replacing it in block/file-posix.c line 1741 and rebuild
and see if it works?
Thank you,
Emanuele
Am 08/02/2023 um 15:56 schrieb Philippe Mathieu-Daudé:
> Cc'ing Emanuele.
>
> On 8/2/23 15:
quot;:true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}'
\
-device
virtio-blk-pci,iothread=iothread1,drive=libvirt-1-format,id=virtio-disk0,bootindex=1,write-cache=on
and observe that it will fail not manage to boot with "qemu_mutex_unlock_
in the current thread's AioContext.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/block/aio.h | 4
include/block/raw-aio.h | 18 --
include/sysemu/block-backend-io.h | 6 ++
block/file-posix.c| 10 +++---
block/linux-aio.c
Use qemu_get_current_aio_context() where possible, since we always
submit work to the current thread anyways.
We want to also be sure that the thread submitting the work is
the same as the one processing the pool, to avoid adding
synchronization to the pool list.
Signed-off-by: Emanuele Giuseppe
in the current thread's AioContext.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/block/aio.h | 4
include/block/raw-aio.h | 15 +++
block/file-posix.c | 12
block/io_uring.c| 23 +++
4 files changed, 30 insertions(+), 24
thread_pool_submit*
* document that functions run in current IOThread
v4:
* add missing aio_context removal, and fix typo
v3:
* remove qemu_coroutine_enter_if_inactive
v2:
* assertion in thread_pool
* remove useless BlockDriverState * param in patch 1 and 2
* io_uring cleaned too
Emanuele Giuseppe Esposito (4
the
ThreadPool function parameter.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/block/thread-pool.h | 10 --
backends/tpm/tpm_backend.c| 4 +---
block/file-posix.c| 4 +---
block/file-win32.c| 4 +---
block/qcow2-threads.c | 3 +--
hw/9pfs/coth.c
ys/devices/system/cpu/vulnerabilities/mmio_stale_data
because the mitigation is present only when the cpu has
(FLUSH_L1D and MD_CLEAR) or FB_CLEAR
features enabled.
Signed-off-by: Emanuele Giuseppe Esposito
---
target/i386/cpu.h | 2 ++
target/i386/cpu.c | 2 +-
2 files changed, 3 insert
.
Emanuele
Emanuele Giuseppe Esposito (2):
target/i386: add support for FLUSH_L1D feature
target/i386: add support for FB_CLEAR feature
target/i386/cpu.h | 3 +++
target/i386/cpu.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
--
2.39.1
es enabled.
Signed-off-by: Emanuele Giuseppe Esposito
---
target/i386/cpu.h | 1 +
target/i386/cpu.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 4948130900..68a6ded0d7 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -97
k: Fix bdrv_co_create_opts_simple() to open images with
> no_co_wrapper
> block: Assert non-coroutine context for bdrv_open_inherit()
>
Apart from a small nitpick in patch 3 where the functions are not marked
as coroutine_fn (but I think this is because BDS callbacks usually don'
Am 17/01/2023 um 18:17 schrieb Kevin Wolf:
> Am 17.01.2023 um 17:43 hat Warner Losh geschrieben:
>> On Tue, Jan 17, 2023 at 9:25 AM Kevin Wolf wrote:
>>
>>> Am 17.01.2023 um 17:16 hat Warner Losh geschrieben:
>>>> On Tue, Jan 17, 2023 at 6:52 AM Ema
Am 17/01/2023 um 17:16 schrieb Warner Losh:
>
>
> On Tue, Jan 17, 2023 at 6:52 AM Emanuele Giuseppe Esposito
> mailto:eespo...@redhat.com>> wrote:
>
> QEMU does not compile when enabling clang's thread safety analysis
> (TSA),
> because some functio
Am 17/01/2023 um 15:33 schrieb Philippe Mathieu-Daudé:
> On 17/1/23 14:52, Emanuele Giuseppe Esposito wrote:
>> QEMU does not compile when enabling clang's thread safety analysis
>> (TSA),
>> because some functions create wrappers for pthread mutexes but do
>> not u
Am 17/01/2023 um 15:02 schrieb Daniel P. Berrangé:
> On Tue, Jan 17, 2023 at 08:52:03AM -0500, Emanuele Giuseppe Esposito wrote:
>> From: Kevin Wolf
>>
>> This enables clang's thread safety analysis (TSA), which we'll use to
>> statically check the block grap
From: Kevin Wolf
This enables clang's thread safety analysis (TSA), which we'll use to
statically check the block graph locking.
Signed-off-by: Kevin Wolf
Message-Id: <20221207131838.239125-9-kw...@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito
Signed-off-by: Kevin Wolf
---
con
functions should use
TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to all
users of pthread_mutex_lock/pthread_mutex_unlock),
simply use TSA_NO_TSA to supppress such warnings.
Signed-off-by: Emanuele Giuseppe Esposito
---
include/qemu/thread.h| 14 +-
util/qemu-thread-posix.c
functions should use
TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to allusers of
pthread_mutex_lock/pthread_mutex_unlock),
simply use TSA_NO_TSA to supppress such warnings.
Signed-off-by: Emanuele Giuseppe Esposito
---
bsd-user/qemu.h | 5 +++--
include/exec/exec-all.h | 5 +++--
2
/qemu-devel/2022-12/msg00903.html
Emanuele Giuseppe Esposito (2):
util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings
bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warnings
Kevin Wolf (1):
configure: Enable -Wthread-safety if present
configure| 1 +
bsd
the function to run in coroutine context.
>
> Pretty much all of the changes in this series were posted by Emanuele
> before as part of "Protect the block layer with a rwlock: part 3". The
> major difference is that in the old version, the patches did two things
> at once:
Am 16/12/2022 um 18:22 schrieb Vladimir Sementsov-Ogievskiy:
> On 12/13/22 11:53, Kevin Wolf wrote:
>> From: Emanuele Giuseppe Esposito
>>
>> The only difference is that blk_ checks if the block is available,
>> but this check is already performed abov
lback. Seems,
> it should be done
>
This has to be done by Paolo & Alberto Faria work to add missing
coroutine_fn and various annotations in a systematic way. It has to be
done using tools like vrc, and not manually because it's not feasible.
Not covered by this serie.
Thank you,
Emanuele
Am 16/12/2022 um 15:26 schrieb Vladimir Sementsov-Ogievskiy:
> On 12/13/22 11:53, Kevin Wolf wrote:
>> From: Emanuele Giuseppe Esposito
>>
>> BlockDriver->bdrv_io_plug is categorized as IO callback, and it
>> currently doesn't run in a coroutine. We should let i
the function to run in coroutine context.
>
> Pretty much all of the changes in this series were posted by Emanuele
> before as part of "Protect the block layer with a rwlock: part 3". The
> major difference is that in the old version, the patches did two things
> at once:
Am 09/12/2022 um 13:18 schrieb Emanuele Giuseppe Esposito:
>
>
> Am 05/12/2022 um 14:01 schrieb Kevin Wolf:
>> Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben:
>>> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote:
>>>>
>>>>
&
Am 05/12/2022 um 14:01 schrieb Kevin Wolf:
> Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben:
>> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote:
>>>
>>>
>>> Am 02/12/2022 um 14:27 schrieb Paolo Bonzini:
>>>> Changes to the BlockDriverStat
river callbacks always expect
> the lock to be taken, therefore they assert.
>
> - blk_co_* functions are called from external code outside the block
> layer, which should not have to care about the block layer's
> internal locking. Usually they also call blk_wait_while_drained().
&
Am 02/12/2022 um 18:22 schrieb Paolo Bonzini:
> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote:
>>
>>
>> Am 02/12/2022 um 14:27 schrieb Paolo Bonzini:
>>> Changes to the BlockDriverState graph will have to take the
>>> corresponding lock for writing,
explained above I believe that it is not valid anymore, and
can be discarded.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
tests/unit/test-bdrv-drain.c | 41
1 file changed, 9 insertions(+), 32 deletions(-)
diff --git a/tests/unit
that we are not in a coroutine.
Move the initialization phase of test_drv_cb and test_quiesce_common
outside the coroutine logic.
Signed-off-by: Emanuele Giuseppe Esposito
---
tests/unit/test-bdrv-drain.c | 118 ++-
1 file changed, 73 insertions(+), 45 deletions
nd 10 from that serie, so if you're
interested take a look).
https://patchew.org/QEMU/20220314131854.2202651-1-eespo...@redhat.com/20220314131854.2202651-7-eespo...@redhat.com/
This serie substitutes Paolo's recent patch:
"[RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines"
Am 02/12/2022 um 14:32 schrieb Robert Hoo:
> On Fri, 2022-12-02 at 13:03 +0100, Emanuele Giuseppe Esposito wrote:
> ...
>>>> @@ -3032,7 +3035,9 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type,
>>>> ...)
>>>> va_end(ap);
>>>>
&g
_test, "backing", 0, _abort);
> +bdrv_set_backing_hd(bs, backing, _abort);
> +}
> +
> +static void test_drv_cb_fini(void)
fini stands for "finito"? :)
Anyways, an alternative solution for this is also here (probably coming
from you too):
https://lists.non
Am 02/12/2022 um 07:54 schrieb Robert Hoo:
> On Fri, 2022-11-11 at 10:47 -0500, Emanuele Giuseppe Esposito wrote:
>> Using the new accel-blocker API, mark where ioctls are being called
>> in KVM. Next, we will implement the critical section that will take
>> care o
This function is never called in coroutine context, therefore
instead of manually creating a new coroutine, delegate it to the
block-coroutine-wrapper script, defining it as co_wrapper.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
In preparation to the incoming new function specifiers,
rename g_c_w with a more meaningful name and document it.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
docs/devel/block-coroutine-wrapper.rst | 6 +--
block/coroutines.h | 4
Extend the regex to cover also return type, pointers included.
This implies that the value returned by the function cannot be
a simple "int" anymore, but the custom return type.
Therefore remove poll_state->ret and instead use a per-function
custom "ret" field.
Signed-of
It is always called in coroutine_fn callbacks, therefore
it can directly call bdrv_co_create().
Rename it to bdrv_co_create_file too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
include/block/block-global-state.h | 3
bdrv_co_common_block_status_above() to avoid using a g_c_w.
Same applies to blk_co_is_allocated_above.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
include/sysemu/block-backend-io.h | 9 +
block/block-backend.c | 21
block/commit.c
suspend (or in other words call qemu_coroutine_yield()).
Therefore we can mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
include/block/block-copy.h | 5
to
c_w.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
include/block/block-common.h | 5 +-
include/block/block-io.h | 10 +++-
include/block/dirty-bitmap.h | 10 +++-
block/dirty-bitmap.c | 88
suspend (or in other words call qemu_coroutine_yield()).
Therefore we can mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/vmdk.c | 36
the advantage of automating
the code creation. In the future all c_w_mixed functions will be
substituted by co_wrapper.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
docs/devel/block-coroutine-wrapper.rst | 6 +-
include/block/block-common.h | 8
(or in other words call qemu_coroutine_yield()).
Therefore we can mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Paolo Bonzini
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
nbd/server.c | 29 -
1
, and default to the main loop if no
BlockDriverState is passed as parameter.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/block-gen.h | 6 +++---
scripts/block-coroutine-wrapper.py | 16
2 files changed, 11
e wrappers that take care of directly
calling the same coroutine functions called in the g_c_w.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
include/block/block-io.h | 15 +++
block/io.c
Call two different functions depending on whether bdrv_create
is in coroutine or not, following the same pattern as
generated_co_wrapper functions.
This allows to also call the coroutine function directly,
without using CreateCo or relying in bdrv_create().
Signed-off-by: Emanuele Giuseppe
We know that the string will stay around until the function
returns, and the parameter of drv->bdrv_co_create_opts is const char*,
so it must not be modified either.
Suggested-by: Kevin Wolf
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Vladimir Sement
t; already present in generated_co_wraper
functions.
- make sure that if a BlockDriver callback is defined as coroutine_fn, then
it is always running in a coroutine.
This serie is based on Kevin Wolf's series "block: Simplify drain".
Based-on: <20221108123738.530873-1-kw...@redha
(?P(_mixed)?)
>
> or
>
> (?Pco_wrapper(_mixed)?)
Ok you couldn't possibly know that, but we are also adding other type of
"variants":
co_wrapper
co_wrapper_mixed
co_wrapper_bdrv_rdlock
co_wrapper_mixed_bdrv_rdlock
Therefore I need to keep variant : str and the regex as it is, but maybe
get rid of the if else condition. I'll change the docstring of course.
If you want to know more, see the thread in
"[PATCH 00/15] Protect the block layer with a rwlock: part 3"
Thank you,
Emanuele
Am 25/11/2022 um 19:03 schrieb Vladimir Sementsov-Ogievskiy:
> On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote:
>> Call two different functions depending on whether bdrv_create
>> is in coroutine or not, following the same pattern as
>> generated_co_wrapper functio
We know that the string will stay around until the function
returns, and the parameter of drv->bdrv_co_create_opts is const char*,
so it must not be modified either.
Suggested-by: Kevin Wolf
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
block.c | 7 ++-
1 f
the advantage of automating
the code creation. In the future all c_w_mixed functions will be
substituted by co_wrapper.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
docs/devel/block-coroutine-wrapper.rst | 6 +-
include/block/block-common.h | 8 +-
scripts/block
to
c_w.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
block/dirty-bitmap.c | 88 +---
block/meson.build| 1 +
include/block/block-common.h | 5 +-
include/block/block-io.h | 10 +++-
include/block/dirty-bitmap.h | 10
t; already present in generated_co_wraper
functions.
- make sure that if a BlockDriver callback is defined as coroutine_fn, then
it is always running in a coroutine.
This serie is based on Kevin Wolf's series "block: Simplify drain".
Based-on: <20221108123738.530873-1-kw...@redha
e wrappers that take care of directly
calling the same coroutine functions called in the g_c_w.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
block/io.c | 58 +---
include/block/block-io.h | 15 +++
2 files changed, 70
Call two different functions depending on whether bdrv_create
is in coroutine or not, following the same pattern as
generated_co_wrapper functions.
This allows to also call the coroutine function directly,
without using CreateCo or relying in bdrv_create().
Signed-off-by: Emanuele Giuseppe
, and default to the main loop if no
BlockDriverState is passed as parameter.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/block-gen.h | 6 +++---
scripts/block-coroutine-wrapper.py | 16
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git
It is always called in coroutine_fn callbacks, therefore
it can directly call bdrv_co_create().
Rename it to bdrv_co_create_file too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
block.c| 5 +++--
block/crypto.c | 2
bdrv_co_common_block_status_above() to avoid using a g_c_w.
Same applies to blk_co_is_allocated_above.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/block-backend.c | 21
block/commit.c| 4 ++--
include/sysemu/block-backend-io.h | 9 +
nbd/server.c
(or in other words call qemu_coroutine_yield()).
Therefore we need to mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
Reviewed-by: Paolo Bonzini
---
nbd/server.c | 29 -
1 file changed, 16 insertions(+), 13
suspend (or in other words call qemu_coroutine_yield()).
Therefore we need to mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Kevin Wolf
---
block/vmdk.c | 36 +++-
1 file changed, 19 insertions
Extend the regex to cover also return type, pointers included.
This implies that the value returned by the function cannot be
a simple "int" anymore, but the custom return type.
Therefore remove poll_state->ret and instead use a per-function
custom "ret" field.
Signed-of
In preparation to the incoming new function specifiers,
rename g_c_w with a more meaningful name and document it.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/coroutines.h | 4 +-
docs/devel/block-coroutine-wrapper.rst | 6 +--
include/block/block-common.h
This function is never called in coroutine context, therefore
instead of manually creating a new coroutine, delegate it to the
block-coroutine-wrapper script, defining it as co_wrapper.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Kevin Wolf
---
block.c
suspend (or in other words call qemu_coroutine_yield()).
Therefore we need to mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito
Reviewed-by: Paolo Bonzini
Reviewed-by: Kevin Wolf
---
block/block-copy.c | 21 -
include/block/block-copy.h
Am 18/11/2022 um 11:57 schrieb Paolo Bonzini:
> On 11/16/22 15:07, Emanuele Giuseppe Esposito wrote:
>> Here we introduce generated_co_wrapper_simple, a simplification of
>> g_c_w that
>> only considers the case where the caller is not in a coroutine.
>> This simplifi
, and default to the main loop if no
BlockDriverState is passed as parameter.
Signed-off-by: Emanuele Giuseppe Esposito
---
block/block-gen.h | 6 +++---
scripts/block-coroutine-wrapper.py | 14 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/block
Extend the regex to cover also return type, pointers included.
This implies that the value returned by the function cannot be
a simple "int" anymore, but the custom return type.
Therefore remove poll_state->ret and instead use a per-function
custom "ret" field.
Signed-of
1 - 100 of 1559 matches
Mail list logo