Re: [PATCH v3 2/3] vfio: selftests: Add vfio_pci_find_mem_bar() helper

From: David Matlack

Date: Mon Nov 02 2026 - 19:54:53 EST


On 2026-11-02 11:04 PM, Mina Almasry wrote:
> Add vfio_pci_find_mem_bar() to libvfio to locate a BAR (or range within
> a BAR) of at least min_size bytes that behaves like ordinary memory and
> can be safely read and written without device-specific side effects.
>
> Detection is backed by a table of known devices, starting with QEMU's
> pci-testdev (1b36:0005) BAR 2 when configured with membar=<size> and
> membar-backed=on.
>
> Suggested-by: David Matlack <dmatlack@xxxxxxxxxx>
> Cc: David Matlack <dmatlack@xxxxxxxxxx>
> Cc: Matt Evans <matt@xxxxxxxxxx>
> Signed-off-by: Mina Almasry <almasrymina@xxxxxxxxxx>

Reviewed-by: David Matlack <dmatlack@xxxxxxxxxx>