Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
migration: qemu_file_total_transferred() function is monotonic
So delta_bytes can only be greater or equal to zero.  Never negative.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230504113841.23130-3-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed May 4, 2023
1 parent 5203334 commit f3030d3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions migration/block.c
Expand Up @@ -801,13 +801,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)

qemu_put_be64(f, BLK_MIG_FLAG_EOS);
delta_bytes = qemu_file_total_transferred(f) - last_bytes;
if (delta_bytes > 0) {
return 1;
} else if (delta_bytes < 0) {
return -1;
} else {
return 0;
}
return (delta_bytes > 0);
}

/* Called with iothread lock taken. */
Expand Down

0 comments on commit f3030d3

Please sign in to comment.