diff mbox

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

Message ID 1265291122-31159-2-git-send-email-nsprei@redhat.com
State New
Headers show

Commit Message

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

Patch

diff --git a/block.c b/block.c
index 527b146..1db9961 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;
         }