diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index 4d55653755..36a50bd569 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -801,6 +801,7 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr ifinfo, char *xmlstr = NULL; virInterfaceDefPtr ifacedef = NULL; char *ret = NULL; + bool active; virCheckFlags(VIR_INTERFACE_XML_INACTIVE, NULL); @@ -812,7 +813,10 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr ifinfo, goto cleanup; } - if ((flags & VIR_INTERFACE_XML_INACTIVE)) { + if (netcfInterfaceObjIsActive(iface, &active) < 0) + goto cleanup; + + if ((flags & VIR_INTERFACE_XML_INACTIVE) || !active) { xmlstr = ncf_if_xml_desc(iface); } else { xmlstr = ncf_if_xml_state(iface);