diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 773c29d6ad..80bc85fad8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12101,9 +12101,12 @@ virDomainDefParseXML(xmlDocPtr xml, def->nets[def->nnets++] = net; - /* must also be in the hostdevs array */ - if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV && - virDomainHostdevInsert(def, &net->data.hostdev.def) < 0) { + /* (and + * where the actual network type is already known to be + * hostdev) must also be in the hostdevs array. + */ + if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV && + virDomainHostdevInsert(def, virDomainNetGetActualHostdev(net)) < 0) { goto error; } }