summaryrefslogtreecommitdiffstats
path: root/migration
diff options
context:
space:
mode:
authorDaniel P. Berrangé2022-06-27 15:53:18 +0200
committerDr. David Alan Gilbert2022-07-20 13:15:09 +0200
commit5f87072e9532a92e6270577665aa2fa659ec0b3f (patch)
tree291a50392575206dcd762161751d401b3827883d /migration
parenttests: Add postcopy preempt tests (diff)
downloadqemu-5f87072e9532a92e6270577665aa2fa659ec0b3f.tar.gz
qemu-5f87072e9532a92e6270577665aa2fa659ec0b3f.tar.xz
qemu-5f87072e9532a92e6270577665aa2fa659ec0b3f.zip
migration: remove unreachable code after reading data
The code calls qio_channel_read() in a loop when it reports QIO_CHANNEL_ERR_BLOCK. This code is reported when errno==EAGAIN. As such the later block of code will always hit the 'errno != EAGAIN' condition, making the final 'else' unreachable. Fixes: Coverity CID 1490203 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220627135318.156121-1-berrange@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/qemu-file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 2f266b25cd..4f400c2e52 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -411,10 +411,8 @@ static ssize_t qemu_fill_buffer(QEMUFile *f)
f->total_transferred += len;
} else if (len == 0) {
qemu_file_set_error_obj(f, -EIO, local_error);
- } else if (len != -EAGAIN) {
- qemu_file_set_error_obj(f, len, local_error);
} else {
- error_free(local_error);
+ qemu_file_set_error_obj(f, len, local_error);
}
return len;