From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPNyZ-0002mJ-2j for qemu-devel@nongnu.org; Sun, 16 Mar 2014 23:12:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPNyT-0005H0-2x for qemu-devel@nongnu.org; Sun, 16 Mar 2014 23:12:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPNyS-0005Gw-Qu for qemu-devel@nongnu.org; Sun, 16 Mar 2014 23:12:25 -0400 Date: Mon, 17 Mar 2014 11:12:31 +0800 From: Fam Zheng Message-ID: <20140317031231.GA28582@T430.nay.redhat.com> References: <20140314155756.GC3324@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140314155756.GC3324@irqsave.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] n ways block filters 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, mreitz@redhat.com On Fri, 03/14 16:57, Beno=EEt Canet wrote: >=20 > Hello list, >=20 > I plan to convert throttling to a block filter and write n way throttli= ng > support. >=20 > I discussed a bit with Stefan on the list and we came to the conclusion= that the > block filter API need group support. >=20 > filter group: > ------------- >=20 > My current plan to implement this is to add the following fields to the= BlockDriver > structure. >=20 > int bdrv_add_filter_group(const char *name, QDict options); > int bdrv_reconfigure_filter_group(const char *name, QDict options); > int bdrv_destroy_filter_group(const char *name); >=20 > These three extra method would allow to create, reconfigure or destroy = a block > filter group. A block filter group contain the shared or non shared sta= te of the > blockfilter. For throttling it would contains the ThrottleState structu= re. >=20 > Each block filter driver would contains a linked list of linked list wh= ere the > BDS are registered grouped by filter groups state. Sorry I don't fully understand this. Does a filter group contain multiple= block filters, and every block filter has effect on multiple BDSes? Could you g= ive an example? >=20 > The regular bdrv_open callback would be used to instantiate a block fil= ter and > add it to a filter group. This method would also take a new-node-name f= or the new > filter. This node-name would become the name of the new filter. > bdrv_close would cleanup and deregister from a filter group. >=20 > An extra filter-group field in the option dict would allow the bdrv_ope= n method > to register the newly opened block filter in it's filter group. > The BDS structure would have a direct pointer to it's filter group stat= e. >=20 > Utility methods to do the bdrv_add_filter_group bdrv_open then bdrv_swa= p to > install a new filter can be provided by block.c. The same can be done f= or filter > close and desinstallation. So you are defining block filter as a new kind of block driver. Is a filt= er always on top above everything else by definition? But I am afraid BlockDriverState is already taking too many responsibilit= ies here (backend, protocol driver, format driver, filter...). I was wonderin= g if it is clearer to rather introduce bs->filter_list to point to a list of BlockFilter (a new sturcture, tailored for a block filter), and don't bot= her with bdrv_swap. Thanks, Fam >=20 > Legacy throttling QMP API > ------------------------- >=20 > The legacy throttling API would create throttling filters groups contai= ning only > one BDS. >=20 > By default for every 1 way block filter block.c would create a filter g= roup > using the BDS id or node-name as group name. This allow for easy filer = removal > with the bds reference. >=20 > Group throttling API > -------------------- >=20 > Commands would be added to create throttling filter groups reconfigure = and remove > them. >=20 > Two additional commands would be added to create and insert a block fil= ter in a > given group or close and remove it. >=20 > Before I start implementing something what are your thougths on this ? >=20 > Best regards >=20 > Beno=EEt >=20 >=20 >=20