Skip to content

Commit

Permalink
migration/rdma: simplify ram_control_load_hook()
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230504114443.23891-3-quintela@redhat.com>
  • Loading branch information
Juan Quintela committed May 4, 2023
1 parent 5f1e754 commit cf7fe0c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions migration/qemu-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ void ram_control_after_iterate(QEMUFile *f, uint64_t flags)

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);
}
Expand All @@ -353,7 +351,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);
}
}
}
Expand Down

0 comments on commit cf7fe0c

Please sign in to comment.