-
由 Kevin Wolf 提交于
bdrv_open_common() implements direct use of protocols by copying the pre-opened BlockDriverStates to bs using bdrv_swap(). It did however first set some fields in bs, which end up in file after the swap. When bdrv_open() destroys file, it appears to be open, and because it isn't, qemu could segfault while trying to close it. Reorder the operations to return immediately in such cases so that file is correctly detected as closed. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
5d186eb0