qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 4/6] qemu-kvm: Introduce cpu_physical_memory_get


From: Avi Kivity
Subject: [Qemu-devel] Re: [PATCH 4/6] qemu-kvm: Introduce cpu_physical_memory_get_dirty_range().
Date: Tue, 16 Mar 2010 14:47:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]