From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOUUl-0002WI-SF for qemu-devel@nongnu.org; Fri, 14 Mar 2014 11:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOUUf-0001un-Tk for qemu-devel@nongnu.org; Fri, 14 Mar 2014 11:58:03 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56178 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOUUf-0001ug-Nb for qemu-devel@nongnu.org; Fri, 14 Mar 2014 11:57:57 -0400 Date: Fri, 14 Mar 2014 16:57:56 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140314155756.GC3324@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] n ways block filters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, mreitz@redhat.com Hello list, I plan to convert throttling to a block filter and write n way throttling support. I discussed a bit with Stefan on the list and we came to the conclusion t= hat the block filter API need group support. filter group: ------------- My current plan to implement this is to add the following fields to the B= lockDriver structure. 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); 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 state= of the blockfilter. For throttling it would contains the ThrottleState structure= . Each block filter driver would contains a linked list of linked list wher= e the BDS are registered grouped by filter groups state. The regular bdrv_open callback would be used to instantiate a block filte= r and add it to a filter group. This method would also take a new-node-name for= the new filter. This node-name would become the name of the new filter. bdrv_close would cleanup and deregister from a filter group. An extra filter-group field in the option dict would allow the bdrv_open = 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 state. Utility methods to do the bdrv_add_filter_group bdrv_open then bdrv_swap = to install a new filter can be provided by block.c. The same can be done for= filter close and desinstallation. Legacy throttling QMP API ------------------------- The legacy throttling API would create throttling filters groups containi= ng only one BDS. By default for every 1 way block filter block.c would create a filter gro= up using the BDS id or node-name as group name. This allow for easy filer re= moval with the bds reference. Group throttling API -------------------- Commands would be added to create throttling filter groups reconfigure an= d remove them. Two additional commands would be added to create and insert a block filte= r in a given group or close and remove it. Before I start implementing something what are your thougths on this ? Best regards Beno=EEt