block: Fix open_flags in bdrv_reopen()
commitf1f25a2e2ea0cd3cdc7d01f2e0afbc4aef6fb853
authorKevin Wolf <kwolf@redhat.com>
Fri, 25 Apr 2014 17:04:55 +0000 (25 19:04 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 30 Apr 2014 09:05:00 +0000 (30 11:05 +0200)
tree6d693540b7cca30374f3ff5a66c79766b532ba67
parent7e3d98dd31b6de53923bfb0f04b23b42a94f3829
block: Fix open_flags in bdrv_reopen()

Use the same function as bdrv_open() for determining what the right
flags for bs->file are. Without doing this, a reopen means that
bs->file loses BDRV_O_CACHE_WB or BDRV_O_UNMAP if bs doesn't have it as
well.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c