Пример #1
0
 private bool ShowNetwork(XenAPI.Network network)
 {
     if (network.IsGuestInstallerNetwork)
     {
         return(false);
     }
     if (network.IsInUseBondSlave)
     {
         return(false);
     }
     if ((this.selected_host != null) && !HalsignHelpers.hostCanSeeNetwork(selected_host, network))
     {
         return(false);
     }
     if ((this.selected_host == null) && !HalsignHelpers.allHostsCanSeeNetwork(network))
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        private bool ShowNetwork(XenAPI.Network network)
        {
            if (network.IsGuestInstallerNetwork)
            {
                return(false);
            }
            if (network.IsInUseBondSlave)
            {
                return(false);
            }

            Host temp_host = null;

            if (this._xenModelObject is VM)
            {
                VM _xenVM = this._xenModelObject as VM;
                temp_host = HalsignHelpers.VMHome(_xenVM);
            }
            else if (this._xenModelObject is Host)
            {
                temp_host = _xenModelObject as Host;
            }
            else
            {
                temp_host = Helpers.GetMaster(this._xenModelObject.Connection);
            }

            if ((temp_host != null) && !HalsignHelpers.hostCanSeeNetwork(temp_host, network))
            {
                return(false);
            }
            if ((temp_host == null) && !HalsignHelpers.allHostsCanSeeNetwork(network))
            {
                return(false);
            }
            return(true);
        }