]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: do not add model when actual iface type is hostdev
authorPaulo de Rezende Pinatti <ppinatti@linux.ibm.com>
Tue, 16 Jun 2020 14:32:10 +0000 (16:32 +0200)
committerLaine Stump <laine@redhat.com>
Wed, 17 Jun 2020 16:04:53 +0000 (12:04 -0400)
No default model should be added to the interface
entry at post parse when its actual network type is hostdev
as doing so might cause a mismatch between the interface
definition and its actual device type.

Signed-off-by: Paulo de Rezende Pinatti <ppinatti@linux.ibm.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_domain.c

index 2dad823a8673710a13916583607e8249f74734df..33ce0ad9920a18262eb073775d7ec2c1dfad04c1 100644 (file)
@@ -5831,6 +5831,7 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net,
                                 virQEMUCapsPtr qemuCaps)
 {
     if (net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
+        virDomainNetResolveActualType(net) != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
         !virDomainNetGetModelString(net))
         net->model = qemuDomainDefaultNetModel(def, qemuCaps);