kvm: Persistent per kvmslot dirty bitmap
commit9f4bf4baa8b820c7930e23c9566c9493db7e1d25
authorPeter Xu <peterx@redhat.com>
Mon, 3 Jun 2019 06:50:53 +0000 (3 14:50 +0800)
committerJuan Quintela <quintela@redhat.com>
Mon, 15 Jul 2019 13:39:03 +0000 (15 15:39 +0200)
treef5dc29b8ced986ff6c8dd73c471799f200dfdefa
parent4a12a11a39a6d8399dd222ae2cebe08a8529224a
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>
accel/kvm/kvm-all.c
include/sysemu/kvm_int.h