aboutsummaryrefslogtreecommitdiff
path: root/block/block-copy.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-05-17 12:05:47 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2021-05-21 18:22:33 +0100
commit29a6ea24eb85d8400df1607a9e11d0ef9ec5e88d (patch)
tree86dbfa59f1ceb9324ee7937f457ac906e6b81069 /block/block-copy.c
parent1485f0c24cfbef7a542ce13d49e9f68e285c57d8 (diff)
coroutine-sleep: replace QemuCoSleepState pointer with struct in the API
Right now, users of qemu_co_sleep_ns_wakeable are simply passing a pointer to QemuCoSleepState by reference to the function. But QemuCoSleepState really is just a Coroutine*; making the content of the struct public is just as efficient and lets us skip the user_state_pointer indirection. Since the usage is changed, take the occasion to rename the struct to QemuCoSleep. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20210517100548.28806-6-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/block-copy.c')
-rw-r--r--block/block-copy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/block-copy.c b/block/block-copy.c
index f896dc56f2..c2e5090412 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -50,7 +50,7 @@ typedef struct BlockCopyCallState {
/* State */
int ret;
bool finished;
- QemuCoSleepState *sleep_state;
+ QemuCoSleep sleep;
bool cancelled;
/* OUT parameters */
@@ -625,8 +625,8 @@ block_copy_dirty_clusters(BlockCopyCallState *call_state)
if (ns > 0) {
block_copy_task_end(task, -EAGAIN);
g_free(task);
- qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, ns,
- &call_state->sleep_state);
+ qemu_co_sleep_ns_wakeable(&call_state->sleep,
+ QEMU_CLOCK_REALTIME, ns);
continue;
}
}
@@ -674,7 +674,7 @@ out:
void block_copy_kick(BlockCopyCallState *call_state)
{
- qemu_co_sleep_wake(call_state->sleep_state);
+ qemu_co_sleep_wake(&call_state->sleep);
}
/*