qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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