On Wed, 7 Jan 2026 at 22:42, Peter Xu <[email protected]> wrote: >> * Should 'hook_data' pointer be g_autofree too? Where is it free'd otherwise? > > hook_data is freed in end_hook(). This patch doesn't change that fact for > postcopy. It's the smae to non-postcopy tests. > >> * The changes look okay; But if tests define hook_data = NULL; Where >> does it get populated? > > It's populated in start_hook() conditionally. When populated, it is always > (and a must) to be released in end_hook().
=== $ grep -Eri 'test_postcopy_common|test_postcopy_recovery_common' tests/qtest/migration/ -l tests/qtest/migration/framework.h tests/qtest/migration/framework.c tests/qtest/migration/tls-tests.c tests/qtest/migration/postcopy-tests.c === * Only tls-tests above seem to define and use these hooks properly along with the hook_data. Postcopy-tests and all other users of start_hook/end_hook don't seem to use [postcopy|hook]_data at all. Do we really need this hook_data parameter? Couldn't it be defined as a tls-tests specific object. (just wondering) Reviewed-by: Prasad Pandit <[email protected]> Thank you. --- - Prasad
