diff options
| author | Juan Quintela <quintela@redhat.com> | 2023-10-25 11:11:17 +0200 |
|---|---|---|
| committer | Juan Quintela <quintela@redhat.com> | 2023-10-31 08:44:33 +0100 |
| commit | be07a0ed22cf10ede7330efbb4818f5896cd6fe3 (patch) | |
| tree | 26437bc4d51707ae334be4aad3f69221ec62f5b0 /migration/migration.c | |
| parent | 0f8596180a304182d4fcf8686b73355de9f37a5d (diff) | |
| download | focaccia-qemu-be07a0ed22cf10ede7330efbb4818f5896cd6fe3.tar.gz focaccia-qemu-be07a0ed22cf10ede7330efbb4818f5896cd6fe3.zip | |
qemu-file: Make qemu_fflush() return errors
This let us simplify code of this shape.
qemu_fflush(f);
int ret = qemu_file_get_error(f);
if (ret) {
return ret;
}
into:
int ret = qemu_fflush(f);
if (ret) {
return ret;
}
I updated all callers where there is any error check.
qemu_fclose() don't need to check for f->last_error because
qemu_fflush() returns it at the beggining of the function.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231025091117.6342-13-quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
| -rw-r--r-- | migration/migration.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/migration/migration.c b/migration/migration.c index aa7b791833..6abcbefd9c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -305,12 +305,7 @@ static int migrate_send_rp_message(MigrationIncomingState *mis, qemu_put_be16(mis->to_src_file, (unsigned int)message_type); qemu_put_be16(mis->to_src_file, len); qemu_put_buffer(mis->to_src_file, data, len); - qemu_fflush(mis->to_src_file); - - /* It's possible that qemu file got error during sending */ - ret = qemu_file_get_error(mis->to_src_file); - - return ret; + return qemu_fflush(mis->to_src_file); } /* Request one page from the source VM at the given start address. |