aboutsummaryrefslogtreecommitdiff
path: root/migration/qemu-file.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-10-25 11:11:17 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-31 08:44:33 +0100
commitbe07a0ed22cf10ede7330efbb4818f5896cd6fe3 (patch)
tree26437bc4d51707ae334be4aad3f69221ec62f5b0 /migration/qemu-file.h
parent0f8596180a304182d4fcf8686b73355de9f37a5d (diff)
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/qemu-file.h')
-rw-r--r--migration/qemu-file.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/qemu-file.h b/migration/qemu-file.h
index 1b2f6b8d8f..1774116f79 100644
--- a/migration/qemu-file.h
+++ b/migration/qemu-file.h
@@ -71,7 +71,7 @@ void qemu_file_set_error_obj(QEMUFile *f, int ret, Error *err);
void qemu_file_set_error(QEMUFile *f, int ret);
int qemu_file_shutdown(QEMUFile *f);
QEMUFile *qemu_file_get_return_path(QEMUFile *f);
-void qemu_fflush(QEMUFile *f);
+int qemu_fflush(QEMUFile *f);
void qemu_file_set_blocking(QEMUFile *f, bool block);
int qemu_file_get_to_fd(QEMUFile *f, int fd, size_t size);