From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/6] qemu-kvm: Introduce cpu_physical_memory_get_dirty_range(). Date: Tue, 16 Mar 2010 14:47:30 +0200 Message-ID: <4B9F7DE2.2010106@redhat.com> References: <1268736839-27371-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> <1268736839-27371-5-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, anthony@codemonkey.ws, ohmura.kei@lab.ntt.co.jp To: Yoshiaki Tamura Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31227 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112Ab0CPMrm (ORCPT ); Tue, 16 Mar 2010 08:47:42 -0400 In-Reply-To: <1268736839-27371-5-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 03/16/2010 12:53 PM, Yoshiaki Tamura wrote: > Introduces cpu_physical_memory_get_dirty_range(). > It checks the first row and puts dirty addr in the array. > If the first row is empty, it skips to the first non-dirty row > or the end addr, and put the length in the first entry of the array. > > > > +/* It checks the first row and puts dirty addrs in the array. > + If the first row is empty, it skips to the first non-dirty row > + or the end addr, and put the length in the first entry of the array. */ > +int cpu_physical_memory_get_dirty_range(ram_addr_t start, ram_addr_t end, > + ram_addr_t *dirty_rams, int length, > + int dirty_flag) > +{ > + unsigned long phys_ram_dirty, page_number, *p; > + ram_addr_t addr; > + int s_idx = (start>> TARGET_PAGE_BITS) / HOST_LONG_BITS; > + int e_idx = (end>> TARGET_PAGE_BITS) / HOST_LONG_BITS; > + int i, j, offset; > + > + switch (dirty_flag) { > + case VGA_DIRTY_FLAG: > + p = phys_ram_vga_dirty; > + break; > + case CODE_DIRTY_FLAG: > + p = phys_ram_code_dirty; > + break; > + case MIGRATION_DIRTY_FLAG: > + p = phys_ram_migration_dirty; > + break; > + default: > + abort(); > + } > This bit would be improved by switching to an array of bitmaps. -- error compiling committee.c: too many arguments to function