On 4/13/23 08:24, Michal Prívozník wrote: > On 4/12/23 18:51, Akihiko Odaki wrote: >> On 2023/04/13 1:23, Michal Prívozník wrote: >>> On 4/10/23 07:48, Akihiko Odaki wrote: >>>> igb is a new network device which will be introduced with QEMU 8.0.0. >>>> It is a successor of e1000e so it has PCIe interface and is understands >>>> virtio-net headers as e1000e does. >>>> >>>> Signed-off-by: Akihiko Odaki <akihiko.odaki@xxxxxxxxxx> >>>> --- >>>> src/conf/domain_conf.c | 1 + >>>> src/conf/domain_conf.h | 1 + >>>> src/qemu/qemu_domain_address.c | 3 ++- >>>> src/qemu/qemu_interface.c | 1 + >>>> 4 files changed, 5 insertions(+), 1 deletion(-) >>>> >>> >>> This looks almost perfect. What is missing is: >>> >>> 1) documentation - might be worth including this onto the list of >>> models, e.g. like this: >>> >>> diff --git i/docs/formatdomain.rst w/docs/formatdomain.rst >>> index 27f83e254d..388c620221 100644 >>> --- i/docs/formatdomain.rst >>> +++ w/docs/formatdomain.rst >>> @@ -5409,6 +5409,7 @@ Typical values for QEMU and KVM include: ne2k_isa >>> i82551 i82557b i82559er >>> ne2k_pci pcnet rtl8139 e1000 virtio. :since:`Since 5.2.0` , >>> ``virtio-transitional`` and ``virtio-non-transitional`` values are >>> supported. >>> See `Virtio transitional devices`_ for more details. >>> +:since:`Since 9.3.0` igb is also supported. >>> >>> Setting NIC driver-specific options >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> >>> >>> 2) QEMU capability, we have an arbitrary list of features that we query >>> QEMU for. This is mostly so that we can check whether QEMU supports >>> requested feature or not. And this new model is so new, that the minimum >>> required QEMU version - 4.2.0 (grep QEMU_MIN_ >>> src/qemu/qemu_capabilities.c) doesn't have it. This is not trivial >>> though, and we'll need Peter's help to regenerate capabilities. >>> >>> IIUC, the IGB was introduced in QEMU commit of v7.2.0-2481-g3a977deebe >>> but the latest capabilities data we have is from >>> v7.2.0-2146-g2946e1af27, i.e. ~350 commits older. >> >> I doubt that a capability is necessary for igb. e1000e is the >> predecessor of the lineage of Intel NICs, but libvirt does not define >> one for it. > > That's because e1000e device was introduced in qemu-2.7.0 > (v2.7.0-rc0~157^2~11) and the minimal version that libvirt requires is > 4.2.0. And there's no way to compile QEMU without the device, is there? > Therefore, libvirt can safely assume the device is always present. But > that's not the case for this brand new IGB device. Ah, spoke too soon. So apparently, for <interface/> models, we do explicitly allow free form strings. I mean, inside of _virDomainNetDef struct we have: int model; /* virDomainNetModelType */ char *modelstr; and then we have virDomainNetSetModelString() and virDomainNetGetModelString() which either set/get model member or modelstr member if it's unknown to libvirt. This means, we can do validation only for 'model' member. So let's stick with what you have and NOT do any validation nor capability. I'm squashing in the docs hunk from above and merging. Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx> Congratulations on your first libvirt contribution! Michal