block: Move initialisation of BlockLimits to bdrv_refresh_limits()

This function separates filling the BlockLimits from bdrv_open(), which
allows it to call it from other operations which may change the limits
(e.g. modifications to the backing file chain or bdrv_reopen)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
This commit is contained in:
Kevin Wolf 2013-12-11 19:26:16 +01:00
parent dabfa6cc2e
commit d34682cd4a
6 changed files with 87 additions and 23 deletions

View file

@ -232,6 +232,8 @@ struct BlockDriver {
int (*bdrv_debug_resume)(BlockDriverState *bs, const char *tag);
bool (*bdrv_debug_is_suspended)(BlockDriverState *bs, const char *tag);
int (*bdrv_refresh_limits)(BlockDriverState *bs);
/*
* Returns 1 if newly created images are guaranteed to contain only
* zeros, 0 otherwise.