Patchwork [v2,resend,4/4] Open backing file read-only also for snapshot mode

login
register
mail settings
Submitter Naphtali Sprei
Date Feb. 4, 2010, 10:04 p.m.
Message ID <1265321069-4105-5-git-send-email-nsprei@redhat.com>
Download mbox | patch
Permalink /patch/44556/
State New
Headers show

Comments

Naphtali Sprei - Feb. 4, 2010, 10:04 p.m.
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 block.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

Patch

diff --git a/block.c b/block.c
index 4a9df91..780cea9 100644
--- a/block.c
+++ b/block.c
@@ -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;
         }