Patchwork [PULL] Fix for kvm dirty logging

login
register
mail settings
Submitter Avi Kivity
Date Jan. 15, 2012, 2:36 p.m.
Message ID <4F12E473.9080700@redhat.com>
Download mbox | patch
Permalink /patch/136187/
State New
Headers show

Comments

Avi Kivity - Jan. 15, 2012, 2:36 p.m.
kvm dirty logging is broken in the presence of memory slots being
removed; this breaks opensuse's boot screen.  Following patch fixes:

  git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/urgent


Avi Kivity (1):
      kvm: flush the dirty log when unregistering a slot

 kvm-all.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

         err = kvm_set_user_memory_region(s, mem);
Anthony Liguori - Jan. 15, 2012, 4:23 p.m.
On 01/15/2012 08:36 AM, Avi Kivity wrote:
> kvm dirty logging is broken in the presence of memory slots being
> removed; this breaks opensuse's boot screen.  Following patch fixes:
>
>    git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/urgent

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> Avi Kivity (1):
>        kvm: flush the dirty log when unregistering a slot
>
>   kvm-all.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/kvm-all.c b/kvm-all.c
> index 3174f42..2cc4562 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -566,6 +566,10 @@ static void kvm_set_phys_mem(MemoryRegionSection
> *section, bool add)
>
>           old = *mem;
>
> +        if (mem->flags&  KVM_MEM_LOG_DIRTY_PAGES) {
> +            kvm_physical_sync_dirty_bitmap(section);
> +        }
> +
>           /* unregister the overlapping slot */
>           mem->memory_size = 0;
>           err = kvm_set_user_memory_region(s, mem);
>

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 3174f42..2cc4562 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -566,6 +566,10 @@  static void kvm_set_phys_mem(MemoryRegionSection
*section, bool add)
 
         old = *mem;
 
+        if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) {
+            kvm_physical_sync_dirty_bitmap(section);
+        }
+
         /* unregister the overlapping slot */
         mem->memory_size = 0;