]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Fix order in bdrv_replace_child()
authorKevin Wolf <kwolf@redhat.com>
Thu, 3 Aug 2017 15:02:57 +0000 (17:02 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 8 Aug 2017 13:19:16 +0000 (15:19 +0200)
commit8aecf1d1bd250a7346165de154f5ccc150ad1aa7
tree0a78b3d42600e4e1ab90bf21c1f768b8154cef42
parente5e6268348972aaf415d7931bbd808b3fdba6cb1
block: Fix order in bdrv_replace_child()

Commit 8ee03995 refactored the code incorrectly and broke the release of
permissions on the old BDS. Instead of changing the permissions to the
new required values after removing the old BDS from the list of
children, it only re-obtains the permissions it already had.

Change the order of operations so that the old BDS is removed again
before calculating the new required permissions.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
block.c