mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-25 04:42:20 +00:00
virDomainNetDefParseXML: Extract network device model earlier
Move the code fetching the model of the net device before the main code parsing individual device types so that the data is available before the upcoming refactor. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8b21305287
commit
6a86e47a6e
@ -9019,6 +9019,10 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
&def->trustGuestRxFilters) < 0)
|
||||
return NULL;
|
||||
|
||||
if ((model = virXPathString("string(./model/@type)", ctxt)) &&
|
||||
virDomainNetSetModelString(def, model) < 0)
|
||||
return NULL;
|
||||
|
||||
if ((source_node = virXPathNode("./source", ctxt))) {
|
||||
if (virDomainNetIPInfoParseXML(_("interface host IP"), source_node, ctxt, &def->hostIP) < 0)
|
||||
return NULL;
|
||||
@ -9202,7 +9206,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
def->script = virXPathString("string(./script/@path)", ctxt);
|
||||
def->downscript = virXPathString("string(./downscript/@path)", ctxt);
|
||||
def->domain_name = virXPathString("string(./backenddomain/@name)", ctxt);
|
||||
model = virXPathString("string(./model/@type)", ctxt);
|
||||
|
||||
if ((filterref_node = virXPathNode("./filterref", ctxt))) {
|
||||
filter = virXMLPropString(filterref_node, "filter");
|
||||
@ -9258,10 +9261,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (model != NULL &&
|
||||
virDomainNetSetModelString(def, model) < 0)
|
||||
return NULL;
|
||||
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_NET_TYPE_NETWORK:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user