[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if
From: |
Jeff Cody |
Subject: |
[Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on |
Date: |
Tue, 21 Jan 2014 11:14:32 -0500 |
Important note: this patch should only be applied after patch
"block: do not allow read-only=on and snapshot=on to be used together"
Now that 'read-only=on' and 'snapshot=on' are not allowed together,
forcing open_flags to have BDRV_O_RDWR set is redundant code, and can be
removed. This is because unless read-only=on is specified, the image
will always be opened with BDRV_O_RDWR set.
Signed-off-by: Jeff Cody <address@hidden>
---
block.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/block.c b/block.c
index dea7591..1a16450 100644
--- a/block.c
+++ b/block.c
@@ -722,13 +722,6 @@ static int bdrv_open_flags(BlockDriverState *bs, int flags)
*/
open_flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING);
- /*
- * Snapshots should be writable.
- */
- if (bs->is_temporary) {
- open_flags |= BDRV_O_RDWR;
- }
-
return open_flags;
}
--
1.8.3.1
- [Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on,
Jeff Cody <=