Skip to contentSkip to conversation

Get the dirty bitmap of a whole VM

Qemu-devel Vincent KHERBACHE 1 participant 1 message Feb 13, 2014

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm trying to calculate the dirty bytes rate of a VM by traveling the corresponding memory dirty bitmaps.

I get a bitmap from KVM kernel space using the following ioctl call :
kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d);

Also, I'm getting the bitmap for each memory slot inside the KVMState object, but I obtain strange results..

I reused some code from the 'kvm_physical_sync_dirty_bitmap' function but I wonder if I should really use each available memory slot ? or if there is a way to obtain the whole 'MemoryRegionSection' of a VM ?

For instance, there is roughly what I do :

/******************************/
KVMState *s = kvm_state;
KVMDirtyLog d;

for (int i=0; i <=; i++) {
    if (&s->slots[i]->memory_size > 0) {
        d.slot = &s->slots[i]->slot;
        kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d);
    }
}

/******************************/

Any help/advice would be welcome.
Thanks,

Signature · 1 line
Vincent KHERBACHE