diff mbox series

migration/block-dirty-bitmap: fix dirty_bitmap_load

Message ID 20180530112424.204835-1-vsementsov@virtuozzo.com
State New
Headers show
Series migration/block-dirty-bitmap: fix dirty_bitmap_load | expand

Commit Message

Vladimir Sementsov-Ogievskiy May 30, 2018, 11:24 a.m. UTC
dirty_bitmap_load_header return code is obtained but not handled. Fix
this.

Bug was introduced in b35ebdf076d697bc
"migration: add postcopy migration of dirty bitmaps" with the whole
function.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 migration/block-dirty-bitmap.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Eric Blake May 30, 2018, 3:22 p.m. UTC | #1
On 05/30/2018 06:24 AM, Vladimir Sementsov-Ogievskiy wrote:
> dirty_bitmap_load_header return code is obtained but not handled. Fix
> this.
> 
> Bug was introduced in b35ebdf076d697bc
> "migration: add postcopy migration of dirty bitmaps" with the whole
> function.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   migration/block-dirty-bitmap.c | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>
John Snow May 30, 2018, 8:25 p.m. UTC | #2
On 05/30/2018 07:24 AM, Vladimir Sementsov-Ogievskiy wrote:
> dirty_bitmap_load_header return code is obtained but not handled. Fix
> this.
> 
> Bug was introduced in b35ebdf076d697bc
> "migration: add postcopy migration of dirty bitmaps" with the whole
> function.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Reviewed-by: John Snow <jsnow@redhat.com>
Dr. David Alan Gilbert June 15, 2018, 11:24 a.m. UTC | #3
* Vladimir Sementsov-Ogievskiy (vsementsov@virtuozzo.com) wrote:
> dirty_bitmap_load_header return code is obtained but not handled. Fix
> this.
> 
> Bug was introduced in b35ebdf076d697bc
> "migration: add postcopy migration of dirty bitmaps" with the whole
> function.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Queued via migration

> ---
>  migration/block-dirty-bitmap.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
> index 8819aabe3a..2c541c985d 100644
> --- a/migration/block-dirty-bitmap.c
> +++ b/migration/block-dirty-bitmap.c
> @@ -672,6 +672,9 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
>  
>      do {
>          ret = dirty_bitmap_load_header(f, &s);
> +        if (ret < 0) {
> +            return ret;
> +        }
>  
>          if (s.flags & DIRTY_BITMAP_MIG_FLAG_START) {
>              ret = dirty_bitmap_load_start(f, &s);
> -- 
> 2.11.1
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 8819aabe3a..2c541c985d 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -672,6 +672,9 @@  static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 
     do {
         ret = dirty_bitmap_load_header(f, &s);
+        if (ret < 0) {
+            return ret;
+        }
 
         if (s.flags & DIRTY_BITMAP_MIG_FLAG_START) {
             ret = dirty_bitmap_load_start(f, &s);