On Thu, Jan 08, 2026 at 03:08:04PM +0530, Prasad Pandit wrote:
> 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)

Sorry I don't follow.  We need the hook_data for cleaning up tls objects
later in end_hook, for either postcopy or other tls tests.

> 
> Reviewed-by: Prasad Pandit <[email protected]>

Thanks,

> 
> Thank you.
> ---
>   - Prasad
> 

-- 
Peter Xu


Reply via email to