Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/qemu-file.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 22af45a5db..9b5e14a2ef 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -317,10 +317,8 @@ void qemu_fflush(QEMUFile *f)
void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data)
{
- int ret = -EINVAL;
-
if (f->hooks && f->hooks->hook_ram_load) {
- ret = f->hooks->hook_ram_load(f, flags, data);
+ int ret = f->hooks->hook_ram_load(f, flags, data);
if (ret < 0) {
qemu_file_set_error(f, ret);
}
@@ -330,7 +328,7 @@ void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data)
* that expects there to be a hook on the destination.
*/
if (flags == RAM_CONTROL_HOOK) {
- qemu_file_set_error(f, ret);
+ qemu_file_set_error(f, -EINVAL);
}
}
}
--
2.40.0