qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v5 20/38] block: Prepare remaining BB functions


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v5 20/38] block: Prepare remaining BB functions for NULL BDS
Date: Tue, 22 Sep 2015 17:07:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 22.09.2015 16:35, Kevin Wolf wrote:
> Am 18.09.2015 um 17:22 hat Max Reitz geschrieben:
>> There are several BlockBackend functions which, in theory, cannot fail.
>> This patch makes them cope with the BlockDriverState pointer being NULL
>> by making them fall back to some default action like ignoring the value
>> in setters and returning the default in getters.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
> 
> Hm, okay, maybe bdrv_drain() belongs here. I just reviewed the end
> result for completeness and didn't check which patch did what.
> 
>>  int blk_enable_write_cache(BlockBackend *blk)
>>  {
>> +    if (!blk->bs) {
>> +        return 0;
>> +    }
>> +
>>      return bdrv_enable_write_cache(blk->bs);
>>  }
>>  
>>  void blk_set_enable_write_cache(BlockBackend *blk, bool wce)
>>  {
>> -    bdrv_set_enable_write_cache(blk->bs, wce);
>> +    if (blk->bs) {
>> +        bdrv_set_enable_write_cache(blk->bs, wce);
>> +    }
>>  }
> 
> WCE is part of the open_flags in BlockBackendRootState. The root state
> doesn't seem to be used yet, and I wrote about my concerns about it in
> reply to an earlier patch, but as long as we have it, should this
> query/modify the root state if no BDS is attached?

Seems very reasonable, will do.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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