From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaQMO-0001cC-6a for qemu-devel@nongnu.org; Tue, 24 Mar 2015 11:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaQMJ-0003eQ-7F for qemu-devel@nongnu.org; Tue, 24 Mar 2015 11:03:16 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:36700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaQMJ-0003dz-02 for qemu-devel@nongnu.org; Tue, 24 Mar 2015 11:03:11 -0400 Received: by wibg7 with SMTP id g7so77213328wib.1 for ; Tue, 24 Mar 2015 08:03:10 -0700 (PDT) Date: Tue, 24 Mar 2015 15:03:07 +0000 From: Stefan Hajnoczi Message-ID: <20150324150307.GD1493@stefanha-thinkpad.redhat.com> References: <3c960428503cfd363a55f72678a2f6a710d94a3e.1426000801.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WChQLJJJfbwij+9x" Content-Disposition: inline In-Reply-To: <3c960428503cfd363a55f72678a2f6a710d94a3e.1426000801.git.berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH 2/6] throttle: Add throttle group infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --WChQLJJJfbwij+9x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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]; --WChQLJJJfbwij+9x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVEXyrAAoJEJykq7OBq3PIEFYIAJrVUEBauGNtnVcbNufq8OmQ QDTny+4UFVwFm48b9u22U35jLnOsNf0bP4aulXCr6ga2oC5bysr/jExdG1vgQPAb Xk5bTMX4aqy1mMMMx4JY/lwQj/1lbtc+dQ7kZN9UFimThpbNr7hKxJIPTX3a2vK9 vBsnGuULm+E+ekmyUgMMULB7W7KibGTUVFo0HHxGcGRkh206i/wNoQd/pnD4f190 YTG5fMgt/+8wqq3Sf44f6og5PG28T8fHVdYR9BpWm/pgnuMDtdBfMOnTyF509QXA CJFOCAmCh2IFZcr8OH4sf6+K5SjAQdUT6uPEJuhaJaUllaOqE8fwRASOdis9l24= =VCMl -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x--