[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: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 11/14] allow writing to the backing file |
Date: |
Thu, 26 Feb 2015 15:15:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 23/02/2015 23:03, Max Reitz wrote:
> 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.
I agree.
Perhaps blkcolo_open or colo_svm_init can take care of setting
BDRV_O_RDWR on the backing file? They could also use bdrv_reopen.
Paolo
> 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);
>
- Re: [Qemu-devel] [RFC PATCH 06/14] NBD client: connect to nbd server later, (continued)
- [Qemu-devel] [RFC PATCH 09/14] block: give backing image its own BlockBackend, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 07/14] NBD client: implement block driver interfaces for block replication, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 10/14] allow the backing image access the origin BlockDriverState, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 11/14] allow writing to the backing file, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 13/14] COW: move cow interfaces to a seperate file, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 08/14] block: add a new API to create a hidden BlockBackend, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 12/14] Add disk buffer for block replication, Wen Congyang, 2015/02/11
- [Qemu-devel] [RFC PATCH 14/14] COLO: implement a new block driver, Wen Congyang, 2015/02/11
- Re: [Qemu-devel] [RFC PATCH 00/14] Block replication for continuous checkpoints, Paolo Bonzini, 2015/02/18