Received: from eggs.gnu.org ([2001:4830:134:3::10]:44747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc9YI-0006Uu-Jo for qemu-devel@nongnu.org; Thu, 09 Oct 2014 04:58:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc9YC-0000o9-FR for qemu-devel@nongnu.org; Thu, 09 Oct 2014 04:58:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc9YC-0000o3-8y for qemu-devel@nongnu.org; Thu, 09 Oct 2014 04:58:20 -0400 Date: Thu, 9 Oct 2014 16:58:22 +0800 From: Fam Zheng Message-ID: <20141009085822.GA4692@fam-t430.nay.redhat.com> References: <1412688279-8312-1-git-send-email-benoit.canet@nodalink.com> <1412688279-8312-8-git-send-email-benoit.canet@nodalink.com> <20141008065338.GD15829@fam-t430.nay.redhat.com> <20141008110553.GA32479@nodalink.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20141008110553.GA32479@nodalink.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 7/8] throttle: Add throttle group support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Wed, 10/08 11:05, Beno=EEt Canet wrote: > On Wed, Oct 08, 2014 at 02:53:38PM +0800, Fam Zheng wrote: > >=20 > > Does this mean that after this series, all the throttle_states must b= e > > contained inside its own throttle group? If so, we could embed Thrott= leGroup > > fields in ThrottleState. > >=20 > > It's weird when a function called throttle_group_compare takes a para= meter of > > ThrottleState pointer, and cast it back to ThrottleGroup with contain= er_of. >=20 > It's done like this to fullfill a design goal: the throttle should be r= eusable > without the groups and any reference to block related stuff. > So it's just a way to split the responsabilities. I see. Having both ThrottleGroup and ThrottleState interfaces is more complicate= d than just use ThrottleGroup, where a one-member group is exactly the same as ThrottleState. Fam