Re: [PATCH 4/6] qemu-kvm: Introduce cpu_physical_memory_get_dirty_range().

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

 



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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux