From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYsq-0003Pv-T6 for qemu-devel@nongnu.org; Thu, 24 May 2012 10:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXYsk-0007SR-Kc for qemu-devel@nongnu.org; Thu, 24 May 2012 10:19:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYsk-0007S9-Bw for qemu-devel@nongnu.org; Thu, 24 May 2012 10:19:14 -0400 Message-ID: <4FBE435C.2050206@redhat.com> Date: Thu, 24 May 2012 16:19:08 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4FB6821A.1080902@redhat.com> <4FBE3A89.8020702@redhat.com> <4FBE3EFE.4020402@zerto.com> In-Reply-To: <4FBE3EFE.4020402@zerto.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Block job commands in QEMU 1.2 [v2, including support for replication] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ori Mamluk Cc: Kevin Wolf , Luiz Capitulino , Eric Blake , qemu-devel , Stefan Hajnoczi Il 24/05/2012 16:00, Ori Mamluk ha scritto: > >> The dirty bitmap is managed by these QMP commands: >> >> * blockdev-dirty-enable: takes a file name used for the dirty bitmap, >> and an optional granularity. Setting the granularity will not be >> supported in the initial version. >> >> * query-block-dirty: returns statistics about the dirty bitmap: right >> now the granularity, the number of bits that are set, and whether QEMU >> is using the dirty bitmap or just adding to it. >> >> * blockdev-dirty-disable: disable the dirty bitmap. >> > > When do bits get cleared from the bitmap? drive-mirror clears bits from the bitmap as it processes the writes. In addition to the persistent dirty bitmap, QEMU keeps an in-flight bitmap. The in-flight bitmap does not need to be persistent. Here is how the bitmaps are handled when doing I/O on the source: - after writing to the source: - clear bit in the volatile in-flight bitmap - set bit in the persistent dirty bitmap - after flushing the source: - msync the persistent bitmap to disk Here is how the bitmaps are handled in the drive-mirror coroutine: - before reading from the source: - set bit in the volatile in-flight bitmap - after writing to the target: - if the dirty count will become zero, flush the target - if the bit is still set in the in-flight bitmap, clear bit in the persistent dirty bitmap - clear bit in the volatile in-flight bitmap > "using the dirty bitmap or just adding to it" - I'm not sure I > understand what you mean. what's the difference? Processing the data and removing from the bitmap (mirroring active), or just setting dirty bits (mirroring inactive). Paolo