On Fri, 2020-08-07 at 17:16 +0100, Daniel P. Berrangé wrote:
On Thu, Aug 06, 2020 at 10:53:32PM -0400, Patrick Magauran wrote:
> Libvirt bases its decision about whether to apply the vnet_hdr flag
> to the tap interface on whether or not the selected model is
> VirtIO. Originally, VirtIO was the only model to support the
> vnet_hdr in QEMU; however, the e1000e & vmxnet3 adapters also
> support it(seemingly from introduction based on commits). This
> passes the whole packet to the host, reducing emulation overhead
> and improving performance.
>
> Signed-off-by: Patrick Magauran <patmagauran.j(a)gmail.com>
> ---
> src/conf/domain_conf.c | 8 +++++++-
> src/conf/domain_conf.h | 1 +
> src/libvirt_private.syms | 1 +
> src/qemu/qemu_interface.c | 8 ++++----
> 4 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 69e0439e7e..cb184110f7 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -30981,7 +30981,13 @@ virDomainNetIsVirtioModel(const
> virDomainNetDef *net)
> net->model == VIR_DOMAIN_NET_MODEL_VIRTIO_TRANSITIONAL
> ||
> net->model ==
> VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL);
> }
> -
> +bool
> +virDomainNetIsVnetCompatModel(const virDomainNetDef *net)
> +{
> + return (virDomainNetIsVirtioModel(net) ||
> + net->model == VIR_DOMAIN_NET_MODEL_E1000E ||
> + net->model == VIR_DOMAIN_NET_MODEL_VMXNET3);
> +}
Should really live in the qemu_inteface.c file, with
a qemuOnterfaceIsVnetCompatModel name, since the decision
is inherantly tied to QEMU, and inappropriate for other
virt drivers.
Regards,
Daniel
I would think the qemu_interface.c file is more for the actual setup
functionality rather than simple helper functions. Would the
qemu_domain.c file make for sense?
--Patrick