Esempio n. 1
0
        /// <summary>
        /// Function tells you when you can / cannot show the network based on the following rules
        /// 1) Don't show the guest installer network or networks with HideFromXenCenter==true.
        /// 2) If you selected an affinity, only show networks that host can see
        /// 3) If you haven't selected an affinity, only show networks all hosts can see
        /// </summary>
        private bool ShowNetwork(XenAPI.Network network)
        {
            if (!network.Show(Properties.Settings.Default.ShowHiddenVMs))
            {
                return(false);
            }

            if (network.IsSlave())
            {
                return(false);
            }

            if (m_selectedAffinity != null && !m_selectedAffinity.CanSeeNetwork(network))
            {
                return(false);
            }

            if (m_selectedAffinity == null && !network.AllHostsCanSeeNetwork())
            {
                return(false);
            }

            if (network.IsSriov() && !m_vm.HasSriovRecommendation())
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        private bool ShowNetwork(object targetRef, XenAPI.Network network, string vsId)
        {
            if (network.IsSriov() && !AllowSriovNetwork(network, vsId))
            {
                return(false);
            }

            if (!network.Show(Properties.Settings.Default.ShowHiddenVMs))
            {
                return(false);
            }

            if (network.IsSlave())
            {
                return(false);
            }

            var  targetHostRef = targetRef as XenRef <Host>;
            Host targetHost    = targetHostRef == null ? null : TargetConnection.Resolve(targetHostRef);

            if (targetHost != null && !targetHost.CanSeeNetwork(network))
            {
                return(false);
            }

            if (targetHost == null && !network.AllHostsCanSeeNetwork())
            {
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        private bool ShowNetwork(Host targetHost, XenAPI.Network network, string vsId)
        {
            if (network.IsSriov() && !AllowSriovNetwork(network, vsId))
            {
                return(false);
            }

            if (!network.Show(Properties.Settings.Default.ShowHiddenVMs))
            {
                return(false);
            }

            if (network.IsSlave())
            {
                return(false);
            }

            if (targetHost != null && !targetHost.CanSeeNetwork(network))
            {
                return(false);
            }

            if (targetHost == null && !network.AllHostsCanSeeNetwork())
            {
                return(false);
            }

            return(true);
        }