From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBwri-00022C-ET for qemu-devel@nongnu.org; Fri, 27 Apr 2018 02:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBwrh-0004NJ-NZ for qemu-devel@nongnu.org; Fri, 27 Apr 2018 02:28:18 -0400 Date: Fri, 27 Apr 2018 14:28:05 +0800 From: Fam Zheng Message-ID: <20180427062805.GG4217@lemon.usersys.redhat.com> References: <20180418030424.28980-1-famz@redhat.com> <20180418030424.28980-4-famz@redhat.com> <20180426153416.GI30991@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180426153416.GI30991@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [Qemu-block] [RFC PATCH v2 3/7] qcow2: Implement copy offloading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Kevin Wolf , Stefan Hajnoczi , qemu-block@nongnu.org, Peter Lieven , Max Reitz , Ronnie Sahlberg , Paolo Bonzini On Thu, 04/26 16:34, Stefan Hajnoczi wrote: > On Wed, Apr 18, 2018 at 11:04:20AM +0800, Fam Zheng wrote: > > +static int qcow2_co_copy_range_to(BlockDriverState *bs, > > + BdrvChild *src, uint64_t src_offset, > > + BdrvChild *dst, uint64_t dst_offset, > > + uint64_t bytes, BdrvRequestFlags flags) > > +{ > > In theory this could increment the refcount if src == dst. It's not > necessary to go down to leaf nodes if the sharing can be handled at the > qcow2 L2 table level. Yes, this is a good optimization to have. Fam