[PATCH v7 3/4] migration/multifd: Add a couple of asserts for p->iov

Fabiano Rosas posted 4 patches 2 months, 3 weeks ago
[PATCH v7 3/4] migration/multifd: Add a couple of asserts for p->iov
Posted by Fabiano Rosas 2 months, 3 weeks ago
Check that p->iov is indeed always allocated and freed by the
MultiFDMethods hooks.

Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 migration/multifd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration/multifd.c b/migration/multifd.c
index 2a8cd9174c..9b200f4ad9 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -466,6 +466,7 @@ static bool multifd_send_cleanup_channel(MultiFDSendParams *p, Error **errp)
     g_free(p->packet);
     p->packet = NULL;
     multifd_send_state->ops->send_cleanup(p, errp);
+    assert(!p->iov);
 
     return *errp == NULL;
 }
@@ -871,6 +872,7 @@ bool multifd_send_setup(void)
             migrate_set_error(s, local_err);
             goto err;
         }
+        assert(p->iov);
     }
 
     return true;
-- 
2.35.3
Re: [PATCH v7 3/4] migration/multifd: Add a couple of asserts for p->iov
Posted by Peter Xu 2 months, 3 weeks ago
On Wed, Aug 28, 2024 at 11:56:49AM -0300, Fabiano Rosas wrote:
> Check that p->iov is indeed always allocated and freed by the
> MultiFDMethods hooks.
> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu