From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBgSB-0000Tw-Kp for qemu-devel@nongnu.org; Wed, 23 Dec 2015 05:15:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBgSA-0007M4-Ig for qemu-devel@nongnu.org; Wed, 23 Dec 2015 05:15:31 -0500 Date: Wed, 23 Dec 2015 18:15:20 +0800 From: Fam Zheng Message-ID: <20151223101520.GL14423@ad.usersys.redhat.com> References: <87vb7vc2yt.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vb7vc2yt.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] Minutes from the "Stuttgart block Gipfele" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Jeff Cody , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , John Snow On Fri, 12/18 14:15, Markus Armbruster wrote: > First, let's examine how such a chain could look like. If we read the > current code correctly, it behaves as if we had a chain > > BB > | > throttle > | > detect-zero > | > copy-on-read > | > BDS > > Except for the backup job, which behaves as if we had > > backup job > / > notifier > | > detect-zero > | > BDS Just to brainstorm block jobs in the dynamic reconfigured node graph: (not sure if this is useful) Nothing stops us from viewing backup as a self-contained filter, [backup] | detect-zero | BDS where its .bdrv_co_writev copies out the old data, and at instantiation time it also creates a long running coroutine (backup_run). In that theory, all other block job types, mirror/stream/commit, fit into a "pull" model, which follows a specified dirty bitmap and copies data from a specified src BDS. In this pull model, mirror (device=d0 target=d1) becomes a pull fileter: BB[d0] BB[d1] | | throttle [pull,src=d0] | | detect-zero detect-zero | | copy-on-read copy-on-read | | BDS BDS Note: the pull reuses most of the block/mirror.c code except the s->dirty_bitmap will be initialized depending on the block job type. In the case of mirror, it is trivially the same as now. stream (device=d0 base=base0) becomes a pull filter: BB[d0] | [pull,src=base0] | detect-zero | copy-on-read | BDS | BDS[base0] Note: s->dirty_bitmap will be initialized with the blocks which should be copied by block-stream. Similarly, active commit (device=d0 base=base0) becomes a pull filter: BB[d0] | detect-zero | copy-on-read | BDS | [pull,src=d0] | BDS[base0] and commit (device=d0 top=base1 base=base0) becomes a pull filter: BB[d0] | detect-zero | copy-on-read | BDS | BDS[base1] | [pull,src=base1] | BDS[base0] If this could work, I'm looking forward to a pretty looking diffstat if we can unify the coroutine code of all four jobs. :) Fam