block: Move some bdrv_*_all() functions to BB

Move bdrv_commit_all() and bdrv_flush_all() to the BlockBackend level.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Max Reitz 2016-03-16 19:54:40 +01:00 committed by Kevin Wolf
parent 7c735873d9
commit fe1a9cbc33
6 changed files with 41 additions and 51 deletions

20
block.c
View file

@ -2521,26 +2521,6 @@ ro_cleanup:
return ret;
}
int bdrv_commit_all(void)
{
BlockDriverState *bs;
QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
AioContext *aio_context = bdrv_get_aio_context(bs);
aio_context_acquire(aio_context);
if (bs->drv && bs->backing) {
int ret = bdrv_commit(bs);
if (ret < 0) {
aio_context_release(aio_context);
return ret;
}
}
aio_context_release(aio_context);
}
return 0;
}
/*
* Return values:
* 0 - success