Skip to contentSkip to conversation

migration/block-dirty-bitmap: fix dirty_bitmap_load

PATCH In review Vladimir Sementsov-Ogievskiy 4 participants 4 messages May 30, 2018 – Jun 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration/block-dirty-bitmap: fix dirty_bitmap_load

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.

---
 migration/block-dirty-bitmap.c | 3 +++
 1 file changed, 3 insertions(+)
migration/block-dirty-bitmap.c +3 -0
index 8819aabe3a..2c541c985d 100644
@@ -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);
Signature · 1 line
2.11.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Vladimir Sementsov-Ogievskiy

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.

---
  migration/block-dirty-bitmap.c | 3 +++
  1 file changed, 3 insertions(+)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#3 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Quoted 8 lines · * Vladimir Sementsov-Ogievskiy ([email protected]) 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.

Queued via migration

Quoted 22 lines
---
 migration/block-dirty-bitmap.c | 3 +++
 1 file changed, 3 insertions(+)
migration/block-dirty-bitmap.c +3 -0
index 8819aabe3a..2c541c985d 100644
@@ -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);
Signature · 1 line
2.11.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK