From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X867f-0001iM-Ls for qemu-devel@nongnu.org; Fri, 18 Jul 2014 07:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X867Y-0002Ch-6O for qemu-devel@nongnu.org; Fri, 18 Jul 2014 07:14:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X867X-0002CV-VC for qemu-devel@nongnu.org; Fri, 18 Jul 2014 07:14:36 -0400 Date: Fri, 18 Jul 2014 12:14:30 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140718111430.GF2384@work-vm> References: <1405596081-29701-1-git-send-email-sanidhya.iiith@gmail.com> <1405596081-29701-4-git-send-email-sanidhya.iiith@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1405596081-29701-4-git-send-email-sanidhya.iiith@gmail.com> Subject: Re: [Qemu-devel] [PATCH v4 3/8] BitmapLog: bitmap dump code via QAPI framework with runstates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sanidhya Kashyap Cc: Amit Shah , qemu list , Juan Quintela * Sanidhya Kashyap (sanidhya.iiith@gmail.com) wrote: One more I forgot: > + while (b->current_epoch <= b->total_epochs) { > + if (!runstate_check(RUN_STATE_DUMP_BITMAP) || > + b->state != LOG_BITMAP_STATE_ACTIVE) { > + goto log_thread_end; > + } > + bitmap_zero(logging_bitmap, ram_bitmap_pages); > + logging_lock(); > + dirty_bitmap_sync(); > + logging_unlock(); > + > + ret = qemu_write_full(fd, logging_bitmap, bitmap_size); > + if (ret < bitmap_size) { > + b->state = LOG_BITMAP_STATE_ERROR; > + goto log_thread_end; > + } > + > + ret = qemu_write_full(fd, &marker, sizeof(char)); > + if (ret < sizeof(char)) { > + b->state = LOG_BITMAP_STATE_ERROR; > + goto log_thread_end; > + } > + g_usleep(b->current_frequency * 1000); Be careful; lets say that was set to 20ms, you wouldn't get 50 dumps a second, since you *add* that delay to the rest of the time in the loop. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK