private void destroyPIFs() { foreach (PIF pif in PIFs) { if (pif.IsTunnelAccessPIF()) { // A tunnel access PIF is destroyed by destroying its tunnel. // (Actually each network will have either all tunnel access PIFs (if // it is a CHIN) or all regular PIFs (if it isn't), but we don't use // that: we do it PIF-by-PIF). foreach (Tunnel tunnel in Connection.ResolveAll(pif.tunnel_access_PIF_of)) // actually there will only ever be one { Tunnel.destroy(Session, tunnel.opaque_ref); } } else { if (!pif.physical) { if (pif.VLAN != -1) { VLAN.destroy(Session, pif.VLAN_master_of); } if (pif.IsSriovLogicalPIF()) { Network_sriov.destroy(Session, pif.sriov_logical_PIF_of[0]); } } else { // do we ever destroy physical pifs anyway? not sure this is something we need but here for completeness PIF.forget(Session, pif.opaque_ref); } } } PIFs = null; }