qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on
@ 2014-01-21 16:14 Jeff Cody
  2014-01-21 16:17 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Cody @ 2014-01-21 16:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

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 <jcody@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-21 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 16:14 [Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on Jeff Cody
2014-01-21 16:17 ` Eric Blake
2014-01-21 16:30   ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).