qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 15/17] block: Disable BDRV_O_COPY_ON_READ for the backing file
Date: Tue, 29 Oct 2013 17:31:07 +0100	[thread overview]
Message-ID: <1383064269-27720-16-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1383064269-27720-1-git-send-email-kwolf@redhat.com>

From: Thibaut LAURENT <thibaut.laurent@gmail.com>

Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c,
bdrv_open_common will throw an error when trying to open a file
read-only with the BDRV_O_COPY_ON_READ flag set.
Although BDRV_O_RDWR is unset for the backing files,
BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
for the drive. Let's unset this flag too before opening the backing
file, or bdrv_open_common will fail.

Signed-off-by: Thibaut LAURENT <thibaut.laurent@gmail.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 366999b..61795fe 100644
--- a/block.c
+++ b/block.c
@@ -999,7 +999,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
     }
 
     /* backing files always opened read-only */
-    back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT);
+    back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT |
+                                    BDRV_O_COPY_ON_READ);
 
     ret = bdrv_open(bs->backing_hd,
                     *backing_filename ? backing_filename : NULL, options,
-- 
1.8.1.4

  parent reply	other threads:[~2013-10-29 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 16:30 [Qemu-devel] [PULL 00/17] Block patches Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 01/17] qapi: fix documentation example Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 02/17] qcow2: Restore total_sectors value in save_vmstate Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 03/17] qcow2: Unset zero_beyond_eof " Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 04/17] qemu-img: add special exit code if bdrv_check is not supported Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 05/17] block/vpc: check that the image has not been truncated Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 06/17] qemu-iotests: Test for loading VM state from qcow2 Kevin Wolf
2013-10-29 16:30 ` [Qemu-devel] [PULL 07/17] qcow2: Flush image after creation Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 08/17] exec: Fix bounce buffer allocation in address_space_map() Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 09/17] ide-test: Check what happens with bus mastering disabled Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 10/17] tests: Multiboot mmap test case Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 11/17] block: Don't copy backing file name on error Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 12/17] sheepdog: explicitly set copies as type uint8_t Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 13/17] sheepdog: pass copy_policy in the request Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 14/17] ahci: fix win7 hang on boot Kevin Wolf
2013-10-29 16:31 ` Kevin Wolf [this message]
2013-10-29 16:31 ` [Qemu-devel] [PULL 16/17] block: Avoid unecessary drv->bdrv_getlength() calls Kevin Wolf
2013-10-29 16:31 ` [Qemu-devel] [PULL 17/17] qemu-iotests: Fix 051 reference output Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383064269-27720-16-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).