[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/29] migration: remove unreachable code after reading data
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 24/29] migration: remove unreachable code after reading data |
Date: |
Tue, 19 Jul 2022 18:02:16 +0100 |
From: Daniel P. Berrangé <berrange@redhat.com>
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>
---
migration/qemu-file.c | 4 +---
1 file changed, 1 insertion(+), 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;
--
2.36.1
- [PULL 11/29] migration: Postcopy preemption preparation on channel creation, (continued)
- [PULL 11/29] migration: Postcopy preemption preparation on channel creation, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 17/29] migration: Export tls-[creds|hostname|authz] params to cmdline too, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 13/29] migration: Postcopy recover with preempt enabled, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 05/29] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 16/29] migration: Add helpers to detect TLS capability, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 12/29] migration: Postcopy preemption enablement, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 14/29] migration: Create the postcopy preempt channel asynchronously, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 23/29] tests: Add postcopy preempt tests, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 19/29] migration: Respect postcopy request order in preemption mode, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 28/29] multifd: Document the locking of MultiFD{Send/Recv}Params, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 24/29] migration: remove unreachable code after reading data,
Dr. David Alan Gilbert (git) <=
- [PULL 29/29] migration: Avoid false-positive on non-supported scenarios for zero-copy-send, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 22/29] tests: Add postcopy tls recovery migration test, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 27/29] migration/multifd: Report to user when zerocopy not working, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 18/29] migration: Enable TLS for preempt channel, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 15/29] migration: Add property x-postcopy-preempt-break-huge, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 20/29] tests: Move MigrateCommon upper, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 10/29] migration: Add postcopy-preempt capability, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 26/29] Add dirty-sync-missed-zero-copy migration stat, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 21/29] tests: Add postcopy tls migration test, Dr. David Alan Gilbert (git), 2022/07/19
- [PULL 25/29] QIOChannelSocket: Fix zero-copy flush returning code 1 when nothing sent, Dr. David Alan Gilbert (git), 2022/07/19