示例#1
0
        private void Update()
        {
            Text = TheSR.Name();
            SetImage();

            if (UnsupportedSR || !TheSR.SupportsVdiCreate() ||
                !TheSR.Show(Properties.Settings.Default.ShowHiddenVMs))
            {
                return;
            }

            if (CanBeEnabled)
            {
                Description = string.Format(Messages.SRPICKER_DISK_FREE, Util.DiskSizeString(TheSR.FreeSpace(), 2),
                                            Util.DiskSizeString(TheSR.physical_size, 2));
                Enabled = true;
                Show    = true;
            }
            else
            {
                Description = DisabledReason;
                Enabled     = false;
                Show        = true;
            }
        }
示例#2
0
 private void CalculateDisabledSortReason()
 {
     if (!TheSR.CanBeSeenFrom(Affinity))
     {
         sortingReason = SrNotEnabledReason.NotSeen;
     }
     else if (TheSR.IsFull || TheSR.FreeSpace < DiskSize)
     {
         sortingReason = SrNotEnabledReason.Full;
     }
     else
     {
         sortingReason = SrNotEnabledReason.Broken;
     }
 }
示例#3
0
        public void Update()
        {
            Text = TheSR.Name;
            SetImage();

            if (UnsupportedSR)
            {
                DoNotShowSR();
            }
            else if (ShowHiddenVDIs && CanBeEnabled && !ExistingVDILocation())
            {
                ShowSREnabled();
            }
            else if (TheSR.PBDs.Count > 0 && TheSR.SupportsVdiCreate())
            {
                ShowSRDisabled();
            }
            else
            {
                DoNotShowSR();
            }
        }
示例#4
0
        private bool CanMigrate(VDI vdi)
        {
            if (TheSR == null || vdi == null)
            {
                return(false);
            }

            bool toLocal = TheSR.IsLocalSR();

            if (toLocal && !HomeHostCanSeeTargetSr(vdi))
            {
                return(false);
            }

            bool fromLocal = vdi.Connection.Resolve(vdi.SR).IsLocalSR();

            if (fromLocal && toLocal)
            {
                return(false);
            }

            return(true);
        }
示例#5
0
        private void Update()
        {
            Text = TheSR.Name();
            SetImage();

            if (UnsupportedSR)
            {
                return;
            }

            if (ShowHiddenVDIs && !ExistingVDILocation() && CanBeEnabled)
            {
                Description = string.Format(Messages.SRPICKER_DISK_FREE, Util.DiskSizeString(TheSR.FreeSpace(), 2),
                                            Util.DiskSizeString(TheSR.physical_size, 2));
                Enabled = true;
                Show    = true;
            }
            else if (TheSR.PBDs.Count > 0 && TheSR.SupportsVdiCreate())
            {
                Description = DisabledReason;
                Enabled     = false;
                Show        = true;
            }
        }
示例#6
0
 private void ShowSREnabled()
 {
     Enabled     = true;
     Description = string.Format(Messages.SRPICKER_DISK_FREE, Util.DiskSizeString(TheSR.FreeSpace(), 2),
                                 Util.DiskSizeString(TheSR.physical_size, 2));
     CalculateEnabledSortReason();
     Show = true;
 }
示例#7
0
 private bool LocalToLocalMove()
 {
     return(TheSR.IsLocalSR() && existingVDIs != null && existingVDIs.Length > 0 && existingVDIs.All(vdi => vdi.Connection.Resolve(vdi.SR).IsLocalSR()));
 }