summary refs log tree commit diff stats
path: root/include/sysemu/kvm_int.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2019-06-03 14:50:53 +0800
committerJuan Quintela <quintela@redhat.com>2019-07-15 15:39:03 +0200
commit9f4bf4baa8b820c7930e23c9566c9493db7e1d25 (patch)
treef5dc29b8ced986ff6c8dd73c471799f200dfdefa /include/sysemu/kvm_int.h
parent4a12a11a39a6d8399dd222ae2cebe08a8529224a (diff)
downloadfocaccia-qemu-9f4bf4baa8b820c7930e23c9566c9493db7e1d25.tar.gz
focaccia-qemu-9f4bf4baa8b820c7930e23c9566c9493db7e1d25.zip
kvm: Persistent per kvmslot dirty bitmap
When synchronizing dirty bitmap from kernel KVM we do it in a
per-kvmslot fashion and we allocate the userspace bitmap for each of
the ioctl.  This patch instead make the bitmap cache be persistent
then we don't need to g_malloc0() every time.

More importantly, the cached per-kvmslot dirty bitmap will be further
used when we want to add support for the KVM_CLEAR_DIRTY_LOG and this
cached bitmap will be used to guarantee we won't clear any unknown
dirty bits otherwise that can be a severe data loss issue for
migration code.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190603065056.25211-9-peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/sysemu/kvm_int.h')
-rw-r--r--include/sysemu/kvm_int.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h
index f838412491..687a2ee423 100644
--- a/include/sysemu/kvm_int.h
+++ b/include/sysemu/kvm_int.h
@@ -21,6 +21,8 @@ typedef struct KVMSlot
     int slot;
     int flags;
     int old_flags;
+    /* Dirty bitmap cache for the slot */
+    unsigned long *dirty_bmap;
 } KVMSlot;
 
 typedef struct KVMMemoryListener {