@@ -483,19 +483,11 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, int flags,
if (bs->backing_format[0] != '\0')
back_drv = bdrv_find_format(bs->backing_format);
- open_flags &= ~BDRV_O_RDWR; /* clear RW, then restore from orig */
- if (bs->is_temporary) {
- open_flags |= (flags & BDRV_O_RDWR);
- }
+ open_flags &= ~BDRV_O_RDWR;
ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags,
back_drv);
if (ret < 0) {
- open_flags &= ~BDRV_O_RDWR; /* Fall-back to read-only for the backing file */
- ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags,
- back_drv);
- }
- if (ret < 0) {
bdrv_close(bs);
return ret;
}
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> --- block.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-)