diff mbox

[37/46] Add assertion to check migration_dirty_pages doesn't go -ve; have seen it happen once but not sure why

Message ID 1404495717-4239-38-git-send-email-dgilbert@redhat.com
State New
Headers show

Commit Message

Dr. David Alan Gilbert July 4, 2014, 5:41 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 arch_init.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Blake July 11, 2014, 3:20 p.m. UTC | #1
On 07/04/2014 11:41 AM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Long subject line. Also, spell out "negative" instead of abbreviating "-ve"

> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  arch_init.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch_init.c b/arch_init.c
> index c006d21..58eccc1 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -439,6 +439,7 @@ ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
>  
>      if (next < size) {
>          clear_bit(next, migration_bitmap);
> +        assert(migration_dirty_pages > 0);
>          migration_dirty_pages--;
>      }
>      *bitoffset = next;
>
Dr. David Alan Gilbert July 11, 2014, 3:41 p.m. UTC | #2
* Eric Blake (eblake@redhat.com) wrote:
> On 07/04/2014 11:41 AM, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Long subject line. Also, spell out "negative" instead of abbreviating "-ve"

Fixed.

Dave

> 
> > 
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> >  arch_init.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch_init.c b/arch_init.c
> > index c006d21..58eccc1 100644
> > --- a/arch_init.c
> > +++ b/arch_init.c
> > @@ -439,6 +439,7 @@ ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
> >  
> >      if (next < size) {
> >          clear_bit(next, migration_bitmap);
> > +        assert(migration_dirty_pages > 0);
> >          migration_dirty_pages--;
> >      }
> >      *bitoffset = next;
> > 
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 


--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index c006d21..58eccc1 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -439,6 +439,7 @@  ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
 
     if (next < size) {
         clear_bit(next, migration_bitmap);
+        assert(migration_dirty_pages > 0);
         migration_dirty_pages--;
     }
     *bitoffset = next;