On 1/1/26 16:10, Roman Bogorodskiy wrote:
> Currently, to probe PCI devices, for each device libvirt
> calls "bhyve -s 0,<device_type>" and parses the error message to check
> if this specific device is supported.
> 
> For quite some time, bhyve reports the list of devices using:
> 
>  bhyve -s help
> 
> where it prints all supported devices, one device per line.
> 
> Update the code to use this command:
> 
>  * It is more accurate as we don't need to rely on the error message
>    parsing.
>  * It's faster as we get all the devices in one run instead of
>    running bhyve for every device type.
>  * The code is simpler.
> 
> Signed-off-by: Roman Bogorodskiy <[email protected]>
> ---
>  src/bhyve/bhyve_capabilities.c | 139 ++++++++++-----------------------
>  1 file changed, 40 insertions(+), 99 deletions(-)

Reviewed-by: Michal Privoznik <[email protected]>

Michal

Reply via email to