[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RESEND 16/50] block: Prepare remaining BB functi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RESEND 16/50] block: Prepare remaining BB functions for NULL BDS |
Date: |
Tue, 27 Jan 2015 14:36:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 01/27/2015 12:45 PM, Max Reitz wrote:
> 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>
> ---
> block/block-backend.c | 70
> ++++++++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 55 insertions(+), 15 deletions(-)
>
> @@ -926,22 +944,32 @@ void *blk_blockalign(BlockBackend *blk, size_t size)
>
> bool blk_op_is_blocked(BlockBackend *blk, BlockOpType op, Error **errp)
> {
> + if (!blk->bs) {
> + return false;
> + }
> +
> return bdrv_op_is_blocked(blk->bs, op, errp);
> }
I don't know if this is correct - maybe a no-medium drive should block
actions like commit by default?
If my design question gets answered satisfactorily that you went with
the right default, then
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH RESEND 02/50] iotests: Only create BB if necessary, (continued)
- [Qemu-devel] [PATCH RESEND 02/50] iotests: Only create BB if necessary, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 08/50] block/quorum: Implement bdrv_is_inserted(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 11/50] block: Move BlockAcctStats into BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 12/50] block: Move I/O status and error actions into BB, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 09/50] block: Move guest_block_size into BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 18/50] block: Respect empty BB in bdrv_query_info(), Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 16/50] block: Prepare remaining BB functions for NULL BDS, Max Reitz, 2015/01/27
- Re: [Qemu-devel] [PATCH RESEND 16/50] block: Prepare remaining BB functions for NULL BDS,
Eric Blake <=
- [Qemu-devel] [PATCH RESEND 10/50] block: Remove wr_highest_offset from BlockAcctStats, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 19/50] blockdev: Use BlockBackend for blockdev-backup TA, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 15/50] block: Fail requests to empty BlockBackend, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 21/50] blockdev: Check BB validity in internal snapshot TA, Max Reitz, 2015/01/27
- [Qemu-devel] [PATCH RESEND 25/50] blockdev: Check BB validity in block-commit, Max Reitz, 2015/01/27