[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 2/6] throttle: Add throttle group infrastructure

From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/6] throttle: Add throttle group infrastructure
Date: Tue, 24 Mar 2015 15:03:07 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Mar 10, 2015 at 05:30:46PM +0200, Alberto Garcia wrote:
> +typedef struct ThrottleGroup {
> +    char *name; /* This is constant during the lifetime of the group */

Is this also protected by throttle_groups_lock?

I guess throttle_groups_lock must be held in order to read this field -
otherwise there is a risk that the object is freed unless you have
already incremented the refcount.

> +
> +    QemuMutex lock;

What does this lock protect?  I guess 'ts', 'head', and 'tokens' fields.
Please document it.

> +    ThrottleState ts;
> +    QLIST_HEAD(, BlockDriverState) head;
> +    BlockDriverState *tokens[2];

Attachment: pgpfkFFHMvJ7m.pgp
Description: PGP signature

reply via email to

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