mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
qed: mark more functions as coroutine_fns and GRAPH_RDLOCK
Mark functions as coroutine_fn when they are only called by other coroutine_fns and they can suspend. Change calls to co_wrappers to use the non-wrapped functions, which in turn requires adding GRAPH_RDLOCK annotations. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20230601115145.196465-3-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
36c6c8773a
commit
bba667da7f
2 changed files with 7 additions and 5 deletions
|
@ -195,14 +195,15 @@ static bool qed_is_image_size_valid(uint64_t image_size, uint32_t cluster_size,
|
|||
*
|
||||
* The string is NUL-terminated.
|
||||
*/
|
||||
static int qed_read_string(BdrvChild *file, uint64_t offset, size_t n,
|
||||
char *buf, size_t buflen)
|
||||
static int coroutine_fn GRAPH_RDLOCK
|
||||
qed_read_string(BdrvChild *file, uint64_t offset,
|
||||
size_t n, char *buf, size_t buflen)
|
||||
{
|
||||
int ret;
|
||||
if (n >= buflen) {
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = bdrv_pread(file, offset, n, buf, 0);
|
||||
ret = bdrv_co_pread(file, offset, n, buf, 0);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue