qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v6 24/39] blockdev: Do not create BDS for empty


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive
Date: Wed, 14 Oct 2015 17:13:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 14.10.2015 15:27, Kevin Wolf wrote:
> Am 12.10.2015 um 22:00 hat Max Reitz geschrieben:
>> Do not use "rudimentary" BDSs for empty drives any longer (for
>> freshly created drives).
>>
>> After a follow-up patch, empty drives will generally use a NULL BDS, not
>> only the freshly created drives.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>>  blockdev.c | 72 
>> ++++++++++++++++++++++++++++++++++++++------------------------
>>  1 file changed, 44 insertions(+), 28 deletions(-)
>>
>> diff --git a/blockdev.c b/blockdev.c
>> index 35efe84..845a1c1 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -514,16 +514,44 @@ static BlockBackend *blockdev_init(const char *file, 
>> QDict *bs_opts,
>>          goto early_err;
>>      }
>>  
>> +    if (snapshot) {
>> +        /* always use cache=unsafe with snapshot */
>> +        bdrv_flags &= ~BDRV_O_CACHE_MASK;
>> +        bdrv_flags |= (BDRV_O_SNAPSHOT|BDRV_O_CACHE_WB|BDRV_O_NO_FLUSH);
>> +    }
>> +
>> +    if (copy_on_read) {
>> +        bdrv_flags |= BDRV_O_COPY_ON_READ;
>> +    }
>> +
>> +    if (runstate_check(RUN_STATE_INMIGRATE)) {
>> +        bdrv_flags |= BDRV_O_INCOMING;
>> +    }
> 
> Bad conflict resolution when you added patch 2, which moved the
> BDRV_O_INCOMING code to block.c?

Oops, indeed. I was wondering why I only removed it once from
blockdev_init(). Thanks.

> That patch is actually essential here as well: The flag would ends up in
> the root state, and bdrv_invalidate_cache_all() doesn't clear the flag
> any more. So we might end up opening an image with BDRV_O_INCOMING even
> though migration has long finished.

Yep. Will fix.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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