migration/multifd: Add a couple of asserts for p->iov

Check that p->iov is indeed always allocated and freed by the
MultiFDMethods hooks.

Suggested-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
Fabiano Rosas 2024-08-28 11:56:49 -03:00
parent 405e352d28
commit 90e0eeb99b

View File

@ -466,6 +466,7 @@ static bool multifd_send_cleanup_channel(MultiFDSendParams *p, Error **errp)
g_free(p->packet); g_free(p->packet);
p->packet = NULL; p->packet = NULL;
multifd_send_state->ops->send_cleanup(p, errp); multifd_send_state->ops->send_cleanup(p, errp);
assert(!p->iov);
return *errp == NULL; return *errp == NULL;
} }
@ -871,6 +872,7 @@ bool multifd_send_setup(void)
migrate_set_error(s, local_err); migrate_set_error(s, local_err);
goto err; goto err;
} }
assert(p->iov);
} }
return true; return true;