block: Don't block_job_pause_all() in bdrv_drain_all()
Block jobs are already paused using the BdrvChildRole drain callbacks, so we don't need an additional block_job_pause_all() call. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7253220de4
commit
8119334918
@ -338,8 +338,6 @@ void bdrv_drain_all_begin(void)
|
|||||||
* context. */
|
* context. */
|
||||||
assert(qemu_get_current_aio_context() == qemu_get_aio_context());
|
assert(qemu_get_current_aio_context() == qemu_get_aio_context());
|
||||||
|
|
||||||
block_job_pause_all();
|
|
||||||
|
|
||||||
for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
|
for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
|
||||||
AioContext *aio_context = bdrv_get_aio_context(bs);
|
AioContext *aio_context = bdrv_get_aio_context(bs);
|
||||||
|
|
||||||
@ -395,8 +393,6 @@ void bdrv_drain_all_end(void)
|
|||||||
aio_enable_external(aio_context);
|
aio_enable_external(aio_context);
|
||||||
aio_context_release(aio_context);
|
aio_context_release(aio_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
block_job_resume_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bdrv_drain_all(void)
|
void bdrv_drain_all(void)
|
||||||
|
@ -284,9 +284,8 @@ static void test_blockjob_common(enum drain_type drain_type)
|
|||||||
do_drain_begin(drain_type, src);
|
do_drain_begin(drain_type, src);
|
||||||
|
|
||||||
if (drain_type == BDRV_DRAIN_ALL) {
|
if (drain_type == BDRV_DRAIN_ALL) {
|
||||||
/* bdrv_drain_all() drains both src and target, and involves an
|
/* bdrv_drain_all() drains both src and target */
|
||||||
* additional block_job_pause_all() */
|
g_assert_cmpint(job->pause_count, ==, 2);
|
||||||
g_assert_cmpint(job->pause_count, ==, 3);
|
|
||||||
} else {
|
} else {
|
||||||
g_assert_cmpint(job->pause_count, ==, 1);
|
g_assert_cmpint(job->pause_count, ==, 1);
|
||||||
}
|
}
|
||||||
@ -303,9 +302,8 @@ static void test_blockjob_common(enum drain_type drain_type)
|
|||||||
do_drain_begin(drain_type, target);
|
do_drain_begin(drain_type, target);
|
||||||
|
|
||||||
if (drain_type == BDRV_DRAIN_ALL) {
|
if (drain_type == BDRV_DRAIN_ALL) {
|
||||||
/* bdrv_drain_all() drains both src and target, and involves an
|
/* bdrv_drain_all() drains both src and target */
|
||||||
* additional block_job_pause_all() */
|
g_assert_cmpint(job->pause_count, ==, 2);
|
||||||
g_assert_cmpint(job->pause_count, ==, 3);
|
|
||||||
} else {
|
} else {
|
||||||
g_assert_cmpint(job->pause_count, ==, 1);
|
g_assert_cmpint(job->pause_count, ==, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user