Ejemplo n.º 1
0
        public bool FiberChannelScan(IWin32Window owner, IXenConnection connection, out List <FibreChannelDevice> devices)
        {
            devices = new List <FibreChannelDevice>();

            Host master = Helpers.GetMaster(connection);

            if (master == null)
            {
                return(false);
            }

            var action = new FibreChannelProbeAction(master, SrType);

            using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
                dialog.ShowDialog(owner); //Will block until dialog closes, action completed

            if (!action.Succeeded)
            {
                return(false);
            }

            devices = action.FibreChannelDevices;
            if (devices != null && devices.Count > 0)
            {
                return(true);
            }

            using (var dlg = new ThreeButtonDialog(
                       new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER)))
            {
                dlg.ShowDialog();
            }
            return(false);
        }
        private bool FiberChannelScan(List <FibreChannelDevice> devices)
        {
            Host master = Helpers.GetMaster(Connection);

            if (master == null)
            {
                return(false);
            }

            FibreChannelProbeAction action = new FibreChannelProbeAction(master);
            ActionProgressDialog    dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee);

            dialog.ShowDialog(this); //Will block until dialog closes, action completed

            if (!action.Succeeded)
            {
                return(false);
            }

            try
            {
                FibreChannelProbeParsing.ProcessXML(action.Result, devices);
                return(true);
            }
            catch (Exception e)
            {
                log.Debug("Exception parsing result of fibre channel scan", e);
                log.Debug(e, e);
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool FiberChannelScan(IWin32Window owner, IXenConnection connection, out List <FibreChannelDevice> devices)
        {
            devices = new List <FibreChannelDevice>();

            Host master = Helpers.GetMaster(connection);

            if (master == null)
            {
                return(false);
            }

            SR.SRTypes srType = this is LVMoFCoE ? SR.SRTypes.lvmofcoe : SR.SRTypes.lvmohba; //srType is a workaround instead of SrType

            FibreChannelProbeAction action = new FibreChannelProbeAction(master, srType);    // TODO: use SRType

            using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
                dialog.ShowDialog(owner); //Will block until dialog closes, action completed

            if (!action.Succeeded)
            {
                return(false);
            }

            try
            {
                devices = FibreChannelProbeParsing.ProcessXML(action.Result);

                if (devices.Count == 0)
                {
                    using (var dlg = new ThreeButtonDialog(
                               new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER)))
                    {
                        dlg.ShowDialog();
                    }

                    return(false);
                }
                return(true);
            }
            catch (Exception e)
            {
                log.Debug("Exception parsing result of fibre channel scan", e);
                log.Debug(e, e);
                using (var dlg = new ThreeButtonDialog(
                           new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_XML_ERROR, Messages.XENCENTER)))
                {
                    dlg.ShowDialog();
                }

                return(false);
            }
        }
        private List <FibreChannelDevice> FiberChannelScan()
        {
            Host master = Helpers.GetMaster(Connection);

            if (master == null)
            {
                return(null);
            }

            var action = new FibreChannelProbeAction(master);

            using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
                dialog.ShowDialog(this); //Will block until dialog closes, action completed

            return(action.Succeeded ? action.FibreChannelDevices : null);
        }
Ejemplo n.º 5
0
        public bool FiberChannelScan(IWin32Window owner, IXenConnection connection, out List <FibreChannelDevice> devices)
        {
            devices = new List <FibreChannelDevice>();

            Host master = Helpers.GetMaster(connection);

            if (master == null)
            {
                return(false);
            }

            FibreChannelProbeAction action = new FibreChannelProbeAction(master, SrType);
            ActionProgressDialog    dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee);

            dialog.ShowDialog(owner); //Will block until dialog closes, action completed

            if (!action.Succeeded)
            {
                return(false);
            }

            try
            {
                FibreChannelProbeParsing.ProcessXML(action.Result, devices);

                if (devices.Count == 0)
                {
                    new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER)).ShowDialog();

                    return(false);
                }
                return(true);
            }
            catch (Exception e)
            {
                log.Debug("Exception parsing result of fibre channel scan", e);
                log.Debug(e, e);
                new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_XML_ERROR, Messages.XENCENTER)).ShowDialog();

                return(false);
            }
        }