qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/50] block/quorum: Implement bdrv_is_inserted(


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 08/50] block/quorum: Implement bdrv_is_inserted()
Date: Tue, 27 Jan 2015 12:20:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 01/26/2015 09:02 AM, Max Reitz wrote:
> bdrv_is_inserted() should be invoked recursively on the children of
> quorum.
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  block/quorum.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/block/quorum.c b/block/quorum.c
> index 437b122..7811c4a 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -1064,6 +1064,20 @@ static void quorum_refresh_filename(BlockDriverState 
> *bs)
>      bs->full_open_options = opts;
>  }
>  
> +static int quorum_is_inserted(BlockDriverState *bs)
> +{
> +    BDRVQuorumState *s = bs->opaque;
> +    int i;
> +
> +    for (i = 0; i < s->num_children; i++) {
> +        if (!bdrv_is_inserted(s->bs[i])) {
> +            return 0;

If you convert the callback to return bool, this may need minor tweaks.
 But they don't affect correctness;

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]