On Fri, Feb 11, 2022 at 12:17:41AM +0800, huang...@chinatelecom.cn wrote:
> +static struct DirtyLimitInfoList *dirtylimit_query_all(void)
> +{
> +    int i, index;
> +    DirtyLimitInfo *info = NULL;
> +    DirtyLimitInfoList *head = NULL, **tail = &head;
> +
> +    dirtylimit_state_lock();
> +
> +    if (!dirtylimit_in_service()) {

Need to unlock?

> +        return NULL;
> +    }
> +
> +    for (i = 0; i < dirtylimit_state->max_cpus; i++) {
> +        index = dirtylimit_state->states[i].cpu_index;
> +        if (dirtylimit_vcpu_get_state(index)->enabled) {
> +            info = dirtylimit_query_vcpu(index);
> +            QAPI_LIST_APPEND(tail, info);
> +        }
> +    }
> +
> +    dirtylimit_state_unlock();
> +
> +    return head;
> +}

-- 
Peter Xu


Reply via email to