mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
async: Remove AsyncContext
The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and can run AIO callbacks of different requests if it weren't for AsyncContexts). Now both qcow and qcow2 are protected by CoMutexes and AsyncContexts can be removed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
52b8eb6013
commit
384acbf46b
7 changed files with 11 additions and 169 deletions
|
@ -179,16 +179,12 @@ int qed_read_l1_table_sync(BDRVQEDState *s)
|
|||
{
|
||||
int ret = -EINPROGRESS;
|
||||
|
||||
async_context_push();
|
||||
|
||||
qed_read_table(s, s->header.l1_table_offset,
|
||||
s->l1_table, qed_sync_cb, &ret);
|
||||
while (ret == -EINPROGRESS) {
|
||||
qemu_aio_wait();
|
||||
}
|
||||
|
||||
async_context_pop();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -205,15 +201,11 @@ int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index,
|
|||
{
|
||||
int ret = -EINPROGRESS;
|
||||
|
||||
async_context_push();
|
||||
|
||||
qed_write_l1_table(s, index, n, qed_sync_cb, &ret);
|
||||
while (ret == -EINPROGRESS) {
|
||||
qemu_aio_wait();
|
||||
}
|
||||
|
||||
async_context_pop();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -282,14 +274,11 @@ int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t offset
|
|||
{
|
||||
int ret = -EINPROGRESS;
|
||||
|
||||
async_context_push();
|
||||
|
||||
qed_read_l2_table(s, request, offset, qed_sync_cb, &ret);
|
||||
while (ret == -EINPROGRESS) {
|
||||
qemu_aio_wait();
|
||||
}
|
||||
|
||||
async_context_pop();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -307,13 +296,10 @@ int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request,
|
|||
{
|
||||
int ret = -EINPROGRESS;
|
||||
|
||||
async_context_push();
|
||||
|
||||
qed_write_l2_table(s, request, index, n, flush, qed_sync_cb, &ret);
|
||||
while (ret == -EINPROGRESS) {
|
||||
qemu_aio_wait();
|
||||
}
|
||||
|
||||
async_context_pop();
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue