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);
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;
}
}