[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 20/38] block: Prepare remaining BB functions
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 17/38] block: Add BlockBackendRootState, (continued)
- [Qemu-devel] [PATCH v5 20/38] block: Prepare remaining BB functions for NULL BDS, Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 21/38] block: Add blk_insert_bs(), Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 22/38] block: Prepare for NULL BDS, Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 23/38] blockdev: Do not create BDS for empty drive, Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 26/38] block: Add blk_remove_bs(), Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 24/38] blockdev: Pull out blockdev option extraction, Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 25/38] blockdev: Allow more options for BB-less BDS tree, Max Reitz, 2015/09/18
- [Qemu-devel] [PATCH v5 27/38] blockdev: Add blockdev-open-tray, Max Reitz, 2015/09/18