qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 11/14] allow writing to the backing file


From: Max Reitz
Subject: Re: [Qemu-devel] [RFC PATCH 11/14] allow writing to the backing file
Date: Mon, 23 Feb 2015 17:03:07 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015-02-11 at 22:07, Wen Congyang wrote:
Signed-off-by: Wen Congyang <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
---
  block.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

I don't think this is a good idea. With this patch, every time you open a COW file (with a backing file) R/W, the backing file will be writable. I'd rather like a way to explicitly overwrite the R/W mode of the backing file; but by default, in my opinion, it should stay read-only.

Max

diff --git a/block.c b/block.c
index 067c44b..96cf973 100644
--- a/block.c
+++ b/block.c
@@ -856,8 +856,8 @@ static int bdrv_inherited_flags(int flags)
   */
  static int bdrv_backing_flags(int flags)
  {
-    /* backing files always opened read-only */
-    flags &= ~(BDRV_O_RDWR | BDRV_O_COPY_ON_READ);
+    /* backing files are opened read-write for block replication */
+    flags &= ~BDRV_O_COPY_ON_READ;
/* snapshot=on is handled on the top layer */
      flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_TEMPORARY);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]