From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAJto-0007Z1-NF for qemu-devel@nongnu.org; Tue, 07 Jun 2016 12:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAJte-0006L7-2y for qemu-devel@nongnu.org; Tue, 07 Jun 2016 12:30:39 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:47771 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAJtd-0006Is-KN for qemu-devel@nongnu.org; Tue, 07 Jun 2016 12:30:29 -0400 References: <1464962711-617992-1-git-send-email-vsementsov@virtuozzo.com> <57519CFA.4000400@redhat.com> <5751A62D.90301@virtuozzo.com> From: Vladimir Sementsov-Ogievskiy Message-ID: <5756F69B.3030308@virtuozzo.com> Date: Tue, 7 Jun 2016 19:30:19 +0300 MIME-Version: 1.0 In-Reply-To: <5751A62D.90301@virtuozzo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] mirror: add target-zeroed flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, lcapitulino@redhat.com, armbru@redhat.com, mreitz@redhat.com, kwolf@redhat.com, jcody@redhat.com On 03.06.2016 18:45, Denis V. Lunev wrote: > On 06/03/2016 06:06 PM, Eric Blake wrote: >> On 06/03/2016 08:05 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Add target-zeroed flag to allow user specify that target is already >>> zeroed. With this flag set zeroes which was in source before mirror >>> start will not be copyed. >> With this flag set, any runs of zeroes in the source before the mirror >> starts will not be copied. >> >>> Without this libvirt migration of empty disk takes too long time. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>> >>> I've tested it with >>> time virsh migrate --live test qemu+ssh://other_node/system >>> --copy-storage-all >> Presumably with a libvirt patch to turn on the optional flag. >> >> I'm not sure I like this patch. Libvirt uses NBD to implement >> --copy-storage-all, I think we're better off improving NBD to >> automatically handle sparse writes, than we are to add a one-off hack >> that requires libvirt to change. That is, once NBD is smarter, the copy >> will be faster without needing a tweak. And we ARE working on making >> NBD smarter (one of my goals for the 2.7 release is to get all the >> sparse file additions to NBD implemented) >> >> That said, I'll still review it. > this is not enough, definitely. > > There is a problem that mirror_iteration code sleeps even for > not read zeroes (and this IS slow). Moreover, even sending sparcified > zeroes takes a lot of time for round trips. > > We have started with that and spent a lot of time trying to improve > the situation. > > Also, as a side note, the QCOW2 file on a source and a target will > be different without the flag - original image has empty blocks, > target image will have blocks explicitly marked with zeroes. > > Though this is a matter of taste... For us this approach is the simplest. > > Den Hey, what do think about it? Don't we forget somebody to be cc'ed? -- Best regards, Vladimir