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

* Re: [Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2014-01-21 16:17 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

On 01/21/2014 09:14 AM, Jeff Cody wrote:
> 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(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] [PATCH] block: remove unnecessary code; image always r/w if snapshot=on
  2014-01-21 16:17 ` Eric Blake
@ 2014-01-21 16:30   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-01-21 16:30 UTC (permalink / raw)
  To: Eric Blake; +Cc: Jeff Cody, qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

Am 21.01.2014 um 17:17 hat Eric Blake geschrieben:
> On 01/21/2014 09:14 AM, Jeff Cody wrote:
> > 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(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks, applied to the block branch.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[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).