[PATCH v3 2/4] vhost: make NUMA reallocation code more robust

Maxime Coquelin maxime.coquelin at redhat.com
Tue Jul 26 10:39:35 CEST 2022



On 7/25/22 22:32, David Marchand wrote:
> translate_ring_addresses and numa_realloc may change a virtio device and
> virtio queue. Callers of those helpers must be extra careful and refresh
> any reference to old data.
> 
> Change those functions prototype as a way to hint about this issue and
> always ask for an indirect pointer.
> 
> Besides, when reallocating the device and queue, the code already made
> sure it will return a pointer to a valid device. The checks on such
> returned pointer can be removed.
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
>   lib/vhost/vhost_user.c | 144 +++++++++++++++++++----------------------
>   1 file changed, 66 insertions(+), 78 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list