Re: [PATCH v3 2/2] vfio: selftests: Avoid VLAs
From: David Matlack
Date: Mon Jun 15 2026 - 18:56:19 EST
On 2026-06-15 12:44 PM, Alex Mastro wrote:
> Allocate VFIO ioctl requests dynamically instead of using VLAs. GCC 11.5.0
> rejects initialized VLAs with:
>
> error: variable-sized object may not be initialized
>
> The replaced stack u8 arrays also do not guarantee native struct alignment
> for the aliased pointers.
>
> Fixes: 19faf6fd969c ("vfio: selftests: Add a helper library for VFIO selftests")
> Fixes: 20face8c75ff ("vfio: selftests: Add helper to set/override a vf_token")
> Assisted-by: Codex:gpt-5.5-high
> Reviewed-by: Vipin Sharma <vipinsh@xxxxxxxxxx>
> Signed-off-by: Alex Mastro <amastro@xxxxxx>
Reviewed-by: David Matlack <dmatlack@xxxxxxxxxx>