ch: Introduce version based cap for network support

This capability checks if ch can receive multiple fds along with net-add
api. This capability is required to enable multiple queues for
domain/guest interfaces.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Praveen K Paladugu 2024-01-16 15:25:42 -06:00 committed by Michal Privoznik
parent e7daa49a15
commit 05d46e4e08
2 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,15 @@ virCHCapsInitCHVersionCaps(int version)
if (version >= 18000000)
virCHCapsSet(chCaps, CH_SERIAL_CONSOLE_IN_PARALLEL);
/* Starting Version 22, add-net api can accept multiple FDs in the request
* This is required to be able to configure queues for virtio-net devices
* from libvirt.
* This capability will be used to gate networking support for ch guests.
* https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v22.0
*/
if (version >= 22000000)
virCHCapsSet(chCaps, CH_MULTIFD_IN_ADDNET);
return g_steal_pointer(&chCaps);
}

View File

@ -26,6 +26,7 @@ typedef enum {
/* 0 */
CH_KERNEL_API_DEPRCATED, /* Use `payload` in place of `kernel` api */
CH_SERIAL_CONSOLE_IN_PARALLEL, /* Serial and Console ports can work in parallel */
CH_MULTIFD_IN_ADDNET, /* Cloud-hypervisor can accept multiple FDs in add-net api */
CH_CAPS_LAST /* this must always be the last item */
} virCHCapsFlags;