1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

qemu: automatically set model type='virtio' for interface type='vhostuser'

Both vdpa and vhostuser require that the guest device be virtio, and
for interface type='vdpa', we already set <model type='virtio'/> if it
is unspecified in the input XML, so let's be just as courteous for
interface type='vhostuser'.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Laine Stump 2025-02-09 18:23:03 -05:00
parent 154d44a585
commit c4746418d7

View File

@ -100,7 +100,8 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDef *net,
const virDomainDef *def,
virQEMUCaps *qemuCaps)
{
if (net->type == VIR_DOMAIN_NET_TYPE_VDPA &&
if ((net->type == VIR_DOMAIN_NET_TYPE_VDPA ||
net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER) &&
!virDomainNetGetModelString(net)) {
net->model = VIR_DOMAIN_NET_MODEL_VIRTIO;
} else if (net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&