diff --git a/XenAdmin/Alerts/Types/MessageAlert.cs b/XenAdmin/Alerts/Types/MessageAlert.cs index 7146d98b4..4f3e97e98 100644 --- a/XenAdmin/Alerts/Types/MessageAlert.cs +++ b/XenAdmin/Alerts/Types/MessageAlert.cs @@ -430,7 +430,7 @@ namespace XenAdmin.Alerts public override void Dismiss() { - new DestroyMessageAction(Message).RunExternal(Connection.Session); + new DestroyMessageAction(Message).RunSync(Connection.Session); RemoveAlert(this); } diff --git a/XenAdmin/Core/Updates.cs b/XenAdmin/Core/Updates.cs index d1a498277..395dc0358 100644 --- a/XenAdmin/Core/Updates.cs +++ b/XenAdmin/Core/Updates.cs @@ -142,7 +142,7 @@ namespace XenAdmin.Core } else { - action.RunExternal(action.Session); + action.RunSync(action.Session); } return action.Succeeded; diff --git a/XenAdmin/Diagnostics/Checks/CfuAvailabilityCheck.cs b/XenAdmin/Diagnostics/Checks/CfuAvailabilityCheck.cs index 502930e1e..7dae2d9ec 100644 --- a/XenAdmin/Diagnostics/Checks/CfuAvailabilityCheck.cs +++ b/XenAdmin/Diagnostics/Checks/CfuAvailabilityCheck.cs @@ -46,7 +46,7 @@ namespace XenAdmin.Diagnostics.Checks try { - action.RunExternal(action.Session); + action.RunSync(action.Session); } catch { diff --git a/XenAdmin/Diagnostics/Checks/DiskSpaceForBatchUpdatesCheck.cs b/XenAdmin/Diagnostics/Checks/DiskSpaceForBatchUpdatesCheck.cs index dd9776ab4..147f98a29 100644 --- a/XenAdmin/Diagnostics/Checks/DiskSpaceForBatchUpdatesCheck.cs +++ b/XenAdmin/Diagnostics/Checks/DiskSpaceForBatchUpdatesCheck.cs @@ -69,7 +69,7 @@ namespace XenAdmin.Diagnostics.Checks try { - action.RunExternal(action.Session); + action.RunSync(action.Session); } catch { diff --git a/XenAdmin/Diagnostics/Checks/PatchPrecheckCheck.cs b/XenAdmin/Diagnostics/Checks/PatchPrecheckCheck.cs index 96360280e..78d018e1c 100644 --- a/XenAdmin/Diagnostics/Checks/PatchPrecheckCheck.cs +++ b/XenAdmin/Diagnostics/Checks/PatchPrecheckCheck.cs @@ -283,7 +283,7 @@ namespace XenAdmin.Diagnostics.Checks : new GetDiskSpaceRequirementsAction(Host, Update.Name(), Update.installation_size, true); try { - action.RunExternal(action.Session); + action.RunSync(action.Session); } catch { diff --git a/XenAdmin/Diagnostics/Hotfixing/SingleHotfix.cs b/XenAdmin/Diagnostics/Hotfixing/SingleHotfix.cs index fb78fff24..b6eaad8fb 100644 --- a/XenAdmin/Diagnostics/Hotfixing/SingleHotfix.cs +++ b/XenAdmin/Diagnostics/Hotfixing/SingleHotfix.cs @@ -75,10 +75,10 @@ namespace XenAdmin.Diagnostics.Hotfixing var coordinator = Helpers.GetCoordinator(host.Connection); var filePath = Path.Combine(Program.AssemblyDir, String.Format("{0}.{1}", Filename, BrandManager.ExtensionUpdate)); var action = new UploadPatchAction(coordinator.Connection, filePath, false, false); - action.RunExternal(session); + action.RunSync(session); patch = action.Patch; } - new ApplyPatchAction(patch, host).RunExternal(session); + new ApplyPatchAction(patch, host).RunSync(session); } private void UploadAndApplyUpdate(Host host, Session session) @@ -89,10 +89,10 @@ namespace XenAdmin.Diagnostics.Hotfixing var coordinator = Helpers.GetCoordinator(host.Connection); var filePath = Path.Combine(Program.AssemblyDir, string.Format("{0}.{1}", Filename, InvisibleMessages.ISO_UPDATE)); var action = new UploadSupplementalPackAction(coordinator.Connection, new List { coordinator }, filePath, false); - action.RunExternal(session); + action.RunSync(session); update = action.PoolUpdate; } - new ApplyUpdateAction(update, host, false).RunExternal(session); + new ApplyUpdateAction(update, host, false).RunSync(session); } public override bool ShouldBeAppliedTo(Host host) diff --git a/XenAdmin/Diagnostics/Problems/PoolProblem/WLBEnabledProblem.cs b/XenAdmin/Diagnostics/Problems/PoolProblem/WLBEnabledProblem.cs index 21278af0c..6654d11fa 100644 --- a/XenAdmin/Diagnostics/Problems/PoolProblem/WLBEnabledProblem.cs +++ b/XenAdmin/Diagnostics/Problems/PoolProblem/WLBEnabledProblem.cs @@ -63,7 +63,7 @@ namespace XenAdmin.Diagnostics.Problems.PoolProblem ss => { var action = new DisableWLBAction(Pool, false); - action.RunExternal(ss); + action.RunSync(ss); int count = 0; while (Helpers.WlbEnabled(Pool.Connection) && count < 10) { diff --git a/XenAdmin/Dialogs/NewDiskDialog.cs b/XenAdmin/Dialogs/NewDiskDialog.cs index d5e986447..b6291e44c 100644 --- a/XenAdmin/Dialogs/NewDiskDialog.cs +++ b/XenAdmin/Dialogs/NewDiskDialog.cs @@ -143,7 +143,7 @@ namespace XenAdmin.Dialogs } if (dialogResult != DialogResult.Yes) return; - new HAUnprotectVMAction(TheVM).RunExternal(TheVM.Connection.Session); + new HAUnprotectVMAction(TheVM).RunSync(TheVM.Connection.Session); } VDI vdi = NewDisk(); diff --git a/XenAdmin/Wizards/DRWizards/DRFailoverWizardPrecheckPage.cs b/XenAdmin/Wizards/DRWizards/DRFailoverWizardPrecheckPage.cs index ae9ae0359..f335c0a26 100644 --- a/XenAdmin/Wizards/DRWizards/DRFailoverWizardPrecheckPage.cs +++ b/XenAdmin/Wizards/DRWizards/DRFailoverWizardPrecheckPage.cs @@ -313,7 +313,7 @@ namespace XenAdmin.Wizards.DRWizards VdiOpenDatabaseAction action = new VdiOpenDatabaseAction(Connection, ((AssertCanBeRecoveredCheck )checkGroup[0]).Vdi); - action.RunExternal(action.Session); + action.RunSync(action.Session); if (action.Succeeded && action.MetadataSession != null) metadataSession = action.MetadataSession; } diff --git a/XenAdmin/Wizards/NewVMWizard/Page_CloudConfigParameters.cs b/XenAdmin/Wizards/NewVMWizard/Page_CloudConfigParameters.cs index b22013ba9..05c1f2359 100644 --- a/XenAdmin/Wizards/NewVMWizard/Page_CloudConfigParameters.cs +++ b/XenAdmin/Wizards/NewVMWizard/Page_CloudConfigParameters.cs @@ -151,7 +151,7 @@ namespace XenAdmin.Wizards.NewVMWizard try { - action.RunExternal(Connection.Session); + action.RunSync(Connection.Session); var result = action.Result.Replace("\n", Environment.NewLine); ConfigDriveTemplateTextBox.Text = result; existingConfig = result; diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/ApplyPoolUpdatePlanAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/ApplyPoolUpdatePlanAction.cs index 757a2ab01..32a5c64d3 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/ApplyPoolUpdatePlanAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/ApplyPoolUpdatePlanAction.cs @@ -56,7 +56,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions EvacuateHost(ref session); AddProgressStep(string.Format(Messages.UPDATES_WIZARD_APPLYING_UPDATE, _poolUpdate.Name(), host.Name())); - new ApplyUpdateAction(_poolUpdate, host, true).RunExternal(session); + new ApplyUpdateAction(_poolUpdate, host, true).RunSync(session); } } } diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/DownloadPatchPlanAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/DownloadPatchPlanAction.cs index 74f8715e9..710b0c1da 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/DownloadPatchPlanAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/DownloadPatchPlanAction.cs @@ -93,7 +93,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions downloadAction.Changed += downloadAndUnzipXenServerPatchAction_Changed; downloadAction.Completed += downloadAndUnzipXenServerPatchAction_Completed; - downloadAction.RunExternal(session); + downloadAction.RunSync(session); } private void downloadAndUnzipXenServerPatchAction_Changed(ActionBase action) diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/InstallSupplementalPackPlanAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/InstallSupplementalPackPlanAction.cs index 69ec9b4d9..12e917930 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/InstallSupplementalPackPlanAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/InstallSupplementalPackPlanAction.cs @@ -52,7 +52,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions { AddProgressStep(string.Format(Messages.UPDATES_WIZARD_APPLYING_UPDATE, vdi.Name(), host.Name())); var suppPackVdis = new Dictionary { { host, vdi } }; - new InstallSupplementalPackAction(suppPackVdis, true).RunExternal(session); + new InstallSupplementalPackAction(suppPackVdis, true).RunSync(session); } } } diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs index 0b40818e5..b79d9df1f 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/RemoveUpdateFile.cs @@ -49,7 +49,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions protected override void RunWithSession(ref Session session) { AddProgressStep(string.Format(Messages.UPDATES_WIZARD_REMOVING_UPDATE, _patch.Name(), _pool.Name())); - new PoolPatchCleanAction(_pool, _patch, true).RunExternal(session); + new PoolPatchCleanAction(_pool, _patch, true).RunSync(session); } } } diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/UnwindProblemsAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/UnwindProblemsAction.cs index d10a1520d..5d512d50c 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/UnwindProblemsAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/UnwindProblemsAction.cs @@ -59,7 +59,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions { var action = _problems[i].CreateUnwindChangesAction(); if (action != null && action.Connection != null && action.Connection.IsConnected) - action.RunExternal(null); + action.RunSync(null); PercentComplete = i * 100 / _problems.Count; } } diff --git a/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToCoordinatorPlanAction.cs b/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToCoordinatorPlanAction.cs index c3e484529..ae0d0f18a 100644 --- a/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToCoordinatorPlanAction.cs +++ b/XenAdmin/Wizards/PatchingWizard/PlanActions/UploadPatchToCoordinatorPlanAction.cs @@ -177,7 +177,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions uploadIsoAction.Changed += uploadAction_Changed; uploadIsoAction.Completed += uploadAction_Completed; inProgressAction = uploadIsoAction; - uploadIsoAction.RunExternal(session); + uploadIsoAction.RunSync(session); var poolUpdate = uploadIsoAction.PoolUpdate; @@ -205,7 +205,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions uploadPatchAction.Changed += uploadAction_Changed; uploadPatchAction.Completed += uploadAction_Completed; inProgressAction = uploadPatchAction; - uploadPatchAction.RunExternal(session); + uploadPatchAction.RunSync(session); // this has to be run again to refresh poolPatches (to get the recently uploaded one as well) var poolPatches = new List(conn.Cache.Pool_patches); @@ -248,7 +248,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions uploadIsoAction.Changed += uploadAction_Changed; uploadIsoAction.Completed += uploadAction_Completed; inProgressAction = uploadIsoAction; - uploadIsoAction.RunExternal(session); + uploadIsoAction.RunSync(session); var poolUpdate = uploadIsoAction.PoolUpdate; @@ -274,7 +274,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions { var checkSpaceForUpload = new CheckDiskSpaceForPatchUploadAction(Helpers.GetCoordinator(conn), path, true); inProgressAction = checkSpaceForUpload; - checkSpaceForUpload.RunExternal(session); + checkSpaceForUpload.RunSync(session); } catch (NotEnoughSpaceException e) { @@ -292,7 +292,7 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions ), null); if (dialogResult is DialogResult dr && dr == DialogResult.OK) - new CleanupDiskSpaceAction(e.DiskSpaceRequirements.Host, null, true).RunExternal(session); + new CleanupDiskSpaceAction(e.DiskSpaceRequirements.Host, null, true).RunSync(session); else throw; } diff --git a/XenAdmin/Wizards/RollingUpgradeWizard/PlanActions/RpuUploadAndApplySuppPackPlanAction.cs b/XenAdmin/Wizards/RollingUpgradeWizard/PlanActions/RpuUploadAndApplySuppPackPlanAction.cs index 4e04d4f50..699a76194 100644 --- a/XenAdmin/Wizards/RollingUpgradeWizard/PlanActions/RpuUploadAndApplySuppPackPlanAction.cs +++ b/XenAdmin/Wizards/RollingUpgradeWizard/PlanActions/RpuUploadAndApplySuppPackPlanAction.cs @@ -134,7 +134,7 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard.PlanActions uploadIsoAction = new UploadSupplementalPackAction(connection, new List { coordinator }, suppPackPath, true); uploadIsoAction.Changed += uploadAction_Changed; uploadIsoAction.Completed += uploadAction_Completed; - uploadIsoAction.RunExternal(session); + uploadIsoAction.RunSync(session); } catch (Exception ex) { diff --git a/XenModel/Actions/AsyncAction.cs b/XenModel/Actions/AsyncAction.cs index 3156e12e9..03f77e93a 100644 --- a/XenModel/Actions/AsyncAction.cs +++ b/XenModel/Actions/AsyncAction.cs @@ -170,7 +170,7 @@ namespace XenAdmin.Actions public void RunAsync(SudoElevationResult sudoElevationResult) { AuditLogStarted(); - System.Threading.ThreadPool.QueueUserWorkItem(RunWorkerThread, sudoElevationResult); + ThreadPool.QueueUserWorkItem(RunWorkerThread, sudoElevationResult); } /// @@ -179,7 +179,7 @@ namespace XenAdmin.Actions /// use that session for the action: it is then the responsibility of the calling function /// to make sure the session has the appropriate privileges and tidy it up afterwards. /// - public void RunExternal(Session session) + public void RunSync(Session session) { RunWorkerThread(session); if (Exception != null) diff --git a/XenModel/Actions/DR/StartVMsAndAppliancesAction.cs b/XenModel/Actions/DR/StartVMsAndAppliancesAction.cs index 352615bc7..9607f566b 100644 --- a/XenModel/Actions/DR/StartVMsAndAppliancesAction.cs +++ b/XenModel/Actions/DR/StartVMsAndAppliancesAction.cs @@ -88,7 +88,7 @@ namespace XenAdmin.Actions.DR action = new VMStartAction(vm, _warningDialogHAInvalidConfig, _startDiagnosisForm); Description = action.Title; action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } @@ -97,7 +97,7 @@ namespace XenAdmin.Actions.DR var action = new StartApplianceAction(vmAppliance, paused); Description = action.Title; action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } } diff --git a/XenModel/Actions/Host/EvacuateHostAction.cs b/XenModel/Actions/Host/EvacuateHostAction.cs index 461557976..03e0a8e33 100644 --- a/XenModel/Actions/Host/EvacuateHostAction.cs +++ b/XenModel/Actions/Host/EvacuateHostAction.cs @@ -112,7 +112,7 @@ namespace XenAdmin.Actions { try { - new HostPowerOnAction(toHost).RunExternal(Session); + new HostPowerOnAction(toHost).RunSync(Session); } catch (Exception) { diff --git a/XenModel/Actions/Host/HostPowerOnAction.cs b/XenModel/Actions/Host/HostPowerOnAction.cs index c748a1d27..67830e430 100644 --- a/XenModel/Actions/Host/HostPowerOnAction.cs +++ b/XenModel/Actions/Host/HostPowerOnAction.cs @@ -121,7 +121,7 @@ namespace XenAdmin.Actions.HostActions if (null != pool) { SendWlbConfigurationAction action = new SendWlbConfigurationAction(pool, hostConfig.ToDictionary(), SendWlbConfigurationKind.SetHostConfiguration); - action.RunExternal(Session); + action.RunSync(Session); } else { diff --git a/XenModel/Actions/Host/SavePowerOnSettingsAction.cs b/XenModel/Actions/Host/SavePowerOnSettingsAction.cs index d64fa90bf..fec351d7c 100644 --- a/XenModel/Actions/Host/SavePowerOnSettingsAction.cs +++ b/XenModel/Actions/Host/SavePowerOnSettingsAction.cs @@ -93,7 +93,7 @@ namespace XenAdmin.Actions var wlbAction = new SendWlbConfigurationAction(pool, hostConfig.ToDictionary(), SendWlbConfigurationKind.SetHostConfiguration); - wlbAction.RunExternal(Session); + wlbAction.RunSync(Session); } } catch diff --git a/XenModel/Actions/MultipleAction.cs b/XenModel/Actions/MultipleAction.cs index c9ecdff9c..81023ee74 100644 --- a/XenModel/Actions/MultipleAction.cs +++ b/XenModel/Actions/MultipleAction.cs @@ -156,7 +156,7 @@ namespace XenAdmin.Actions try { SubActionTitle = subAction.Title; - subAction.RunExternal(Session); + subAction.RunSync(Session); } catch (Exception e) { diff --git a/XenModel/Actions/ParallelAction.cs b/XenModel/Actions/ParallelAction.cs index 2a14c912c..8adfb9c2c 100644 --- a/XenModel/Actions/ParallelAction.cs +++ b/XenModel/Actions/ParallelAction.cs @@ -139,7 +139,7 @@ namespace XenAdmin.Actions return; try { - action.RunExternal(action.Session); + action.RunSync(action.Session); } catch (Exception e) { diff --git a/XenModel/Actions/Perfmon/PerfmonDefinitionAction.cs b/XenModel/Actions/Perfmon/PerfmonDefinitionAction.cs index 028e3e11a..fedc00900 100644 --- a/XenModel/Actions/Perfmon/PerfmonDefinitionAction.cs +++ b/XenModel/Actions/Perfmon/PerfmonDefinitionAction.cs @@ -170,7 +170,7 @@ namespace XenAdmin.Actions new RunPluginAction(host.Connection, host, XenServerPlugins.PLUGIN_PERFMON_PLUGIN, XenServerPlugins.PLUGIN_PERFMON_FUNCTION_REFRESH, - new Dictionary(), true).RunExternal(Session); + new Dictionary(), true).RunSync(Session); } catch (Exception e) { @@ -183,12 +183,12 @@ namespace XenAdmin.Actions new RunPluginAction(host.Connection, host, XenServerPlugins.PLUGIN_PERFMON_PLUGIN, XenServerPlugins.PLUGIN_PERFMON_FUNCTION_START, - new Dictionary(), true).RunExternal(Session); + new Dictionary(), true).RunSync(Session); new RunPluginAction(host.Connection, host, XenServerPlugins.PLUGIN_PERFMON_PLUGIN, XenServerPlugins.PLUGIN_PERFMON_FUNCTION_REFRESH, - new Dictionary(), true).RunExternal(Session); + new Dictionary(), true).RunSync(Session); } catch (Exception ex) { diff --git a/XenModel/Actions/Pool/PoolAction.cs b/XenModel/Actions/Pool/PoolAction.cs index eb0896af7..0a6819262 100644 --- a/XenModel/Actions/Pool/PoolAction.cs +++ b/XenModel/Actions/Pool/PoolAction.cs @@ -68,7 +68,7 @@ namespace XenAdmin.Actions Host poolCoordinator = Helpers.GetCoordinator(pool); AsyncAction action = new ApplyLicenseEditionAction(hostsToRelicense.ConvertAll(h=>h as IXenObject), Host.GetEdition(poolCoordinator.edition), poolCoordinator.license_server["address"], poolCoordinator.license_server["port"], doOnLicensingFailure); - action.RunExternal(null); + action.RunSync(null); } /// @@ -167,7 +167,7 @@ namespace XenAdmin.Actions action = new EnableAdAction(h.Connection, poolCoordinator.external_auth_service_name, adUserAndPassword.Username, adUserAndPassword.Password) {Host = h}; - action.RunExternal(null); + action.RunSync(null); } } catch (EnableAdAction.CredentialsFailure) diff --git a/XenModel/Actions/Pool_Patch/CheckDiskSpaceForPatchUploadAction.cs b/XenModel/Actions/Pool_Patch/CheckDiskSpaceForPatchUploadAction.cs index e340d4591..2c4113fcd 100644 --- a/XenModel/Actions/Pool_Patch/CheckDiskSpaceForPatchUploadAction.cs +++ b/XenModel/Actions/Pool_Patch/CheckDiskSpaceForPatchUploadAction.cs @@ -84,7 +84,7 @@ namespace XenAdmin.Actions var getDiskSpaceRequirementsAction = new GetDiskSpaceRequirementsAction(Host, fileName, fileSize, true); try { - getDiskSpaceRequirementsAction.RunExternal(Session); + getDiskSpaceRequirementsAction.RunSync(Session); diskSpaceRequirements = getDiskSpaceRequirementsAction.DiskSpaceRequirements; } catch (Failure failure) diff --git a/XenModel/Actions/SR/SrIntroduceAction.cs b/XenModel/Actions/SR/SrIntroduceAction.cs index b24da45a3..99451f89f 100644 --- a/XenModel/Actions/SR/SrIntroduceAction.cs +++ b/XenModel/Actions/SR/SrIntroduceAction.cs @@ -132,7 +132,7 @@ namespace XenAdmin.Actions throw new Failure(Failure.HANDLE_INVALID, "SR", Result); // Set this SR to be the default - new SrAction(SrActionKind.SetAsDefault, new_sr).RunExternal(Session); + new SrAction(SrActionKind.SetAsDefault, new_sr).RunSync(Session); } Description = Messages.ACTION_SR_ATTACH_SUCCESSFUL; diff --git a/XenModel/Actions/StorageLink/SrCreateAction.cs b/XenModel/Actions/StorageLink/SrCreateAction.cs index d126f55a9..96bbfc056 100644 --- a/XenModel/Actions/StorageLink/SrCreateAction.cs +++ b/XenModel/Actions/StorageLink/SrCreateAction.cs @@ -211,7 +211,7 @@ namespace XenAdmin.Actions throw new Failure(Failure.HANDLE_INVALID, "SR", Result); // Set this SR to be the default - new SrAction(SrActionKind.SetAsDefault, new_sr).RunExternal(Session); + new SrAction(SrActionKind.SetAsDefault, new_sr).RunSync(Session); } Description = Messages.ACTION_SR_CREATE_SUCCESSFUL; diff --git a/XenModel/Actions/VDI/DestroyDiskAction.cs b/XenModel/Actions/VDI/DestroyDiskAction.cs index 2a141cae0..691064ad6 100644 --- a/XenModel/Actions/VDI/DestroyDiskAction.cs +++ b/XenModel/Actions/VDI/DestroyDiskAction.cs @@ -95,7 +95,7 @@ namespace XenAdmin.Actions Helpers.GetName(vm).Ellipsise(20))); } DetachVirtualDiskAction action = new DetachVirtualDiskAction(Disk, vm, false); - action.RunExternal(Session); + action.RunSync(Session); } RelatedTask = XenAPI.VDI.async_destroy(Session, Disk.opaque_ref); diff --git a/XenModel/Actions/VIF/UpdateVIFAction.cs b/XenModel/Actions/VIF/UpdateVIFAction.cs index 2bdb7c63e..6f6fd41b0 100644 --- a/XenModel/Actions/VIF/UpdateVIFAction.cs +++ b/XenModel/Actions/VIF/UpdateVIFAction.cs @@ -55,10 +55,10 @@ namespace XenAdmin.Actions { Description = Messages.ACTION_VIF_UPDATING; - new DeleteVIFAction(vif, true).RunExternal(Session); + new DeleteVIFAction(vif, true).RunSync(Session); var createAction = new CreateVIFAction(VM, vifDescriptor, true); - createAction.RunExternal(Session); + createAction.RunSync(Session); RebootRequired = createAction.RebootRequired; Description = Messages.ACTION_VIF_UPDATED; diff --git a/XenModel/Actions/VM/ChangeMemorySettingsAction.cs b/XenModel/Actions/VM/ChangeMemorySettingsAction.cs index dc00fdcc0..63f3a6a0d 100644 --- a/XenModel/Actions/VM/ChangeMemorySettingsAction.cs +++ b/XenModel/Actions/VM/ChangeMemorySettingsAction.cs @@ -107,7 +107,7 @@ namespace XenAdmin.Actions try { - action.RunExternal(Session); + action.RunSync(Session); } catch { @@ -146,7 +146,7 @@ namespace XenAdmin.Actions else action = new VMStartOnAction(VM, _vmHost, _warningDialogHaInvalidConfig, _startDiagnosticForm); - action.RunExternal(Session); + action.RunSync(Session); } } diff --git a/XenModel/Actions/VM/CreateCdDriveAction.cs b/XenModel/Actions/VM/CreateCdDriveAction.cs index 66e787548..958f4b2c9 100644 --- a/XenModel/Actions/VM/CreateCdDriveAction.cs +++ b/XenModel/Actions/VM/CreateCdDriveAction.cs @@ -87,7 +87,7 @@ namespace XenAdmin.Actions var cdCreate = new VbdSaveAndPlugAction(VM, cdDrive, Messages.DVD_DRIVE, Session, true); cdCreate.ShowUserInstruction += msg => ShowUserInstruction?.Invoke(msg); - cdCreate.RunExternal(Session); + cdCreate.RunSync(Session); Description = Messages.NEW_DVD_DRIVE_DONE; } } diff --git a/XenModel/Actions/VM/CreateVMAction.cs b/XenModel/Actions/VM/CreateVMAction.cs index 229cb7353..3b54bb06e 100644 --- a/XenModel/Actions/VM/CreateVMAction.cs +++ b/XenModel/Actions/VM/CreateVMAction.cs @@ -284,7 +284,7 @@ namespace XenAdmin.Actions.VMActions parameters, true); //hidefromlogs - action.RunExternal(Connection.Session); + action.RunSync(Connection.Session); var result = action.Result.Replace("\n", Environment.NewLine); } } @@ -304,7 +304,7 @@ namespace XenAdmin.Actions.VMActions }); } var action = new GpuAssignAction(VM, newvGpus); - action.RunExternal(Session); + action.RunSync(Session); } } @@ -329,7 +329,7 @@ namespace XenAdmin.Actions.VMActions XenAPI.VM.set_name_label(Session, VM.opaque_ref, NameLabel); XenAPI.VM.set_name_description(Session, VM.opaque_ref, NameDescription); ChangeVCPUSettingsAction vcpuAction = new ChangeVCPUSettingsAction(VM, VcpusMax, VcpusAtStartup); - vcpuAction.RunExternal(Session); + vcpuAction.RunSync(Session); // set cores-per-socket Dictionary platform = VM.platform == null ? diff --git a/XenModel/Actions/VM/InstallPVToolsAction.cs b/XenModel/Actions/VM/InstallPVToolsAction.cs index dac89b78b..1ba450166 100644 --- a/XenModel/Actions/VM/InstallPVToolsAction.cs +++ b/XenModel/Actions/VM/InstallPVToolsAction.cs @@ -75,7 +75,7 @@ namespace XenAdmin.Actions try { SrRepairAction action = new SrRepairAction(sr.Connection, sr, false); - action.RunExternal(Session); + action.RunSync(Session); } catch (Failure f) { diff --git a/XenModel/Actions/VM/ResumeAndStartVMsAction.cs b/XenModel/Actions/VM/ResumeAndStartVMsAction.cs index 416e4edb4..7a91e0b71 100644 --- a/XenModel/Actions/VM/ResumeAndStartVMsAction.cs +++ b/XenModel/Actions/VM/ResumeAndStartVMsAction.cs @@ -82,7 +82,7 @@ namespace XenAdmin.Actions.VMActions action = new VMResumeAction(vm, _warningDialogHAInvalidConfig, _startDiagnosisForm); action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } @@ -97,7 +97,7 @@ namespace XenAdmin.Actions.VMActions action = new VMStartAction(vm, _warningDialogHAInvalidConfig, _startDiagnosisForm); action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } } diff --git a/XenModel/Actions/VM/SuspendAndShutdownVMsAction.cs b/XenModel/Actions/VM/SuspendAndShutdownVMsAction.cs index b80184691..7a64f68b5 100644 --- a/XenModel/Actions/VM/SuspendAndShutdownVMsAction.cs +++ b/XenModel/Actions/VM/SuspendAndShutdownVMsAction.cs @@ -72,7 +72,7 @@ namespace XenAdmin.Actions.VMActions Description = string.Format(Messages.SUSPENDING_VM_OUT_OF, ActionCountCompleted + 1, VmsToSuspend.Count); var action = new VMSuspendAction(vm); action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } @@ -81,7 +81,7 @@ namespace XenAdmin.Actions.VMActions Description = string.Format(Messages.SHUTTING_DOWN_VM_OUT_OF, ActionCountCompleted - VmsToSuspend.Count + 1, VmsToShutdown.Count); var action = new VMHardShutdown(vm); action.Changed += action_Changed; - action.RunExternal(Session); + action.RunSync(Session); ActionCountCompleted++; } } diff --git a/XenModel/Actions/VM/VMStartAction.cs b/XenModel/Actions/VM/VMStartAction.cs index 7f0ff46db..0e5ec2068 100644 --- a/XenModel/Actions/VM/VMStartAction.cs +++ b/XenModel/Actions/VM/VMStartAction.cs @@ -85,7 +85,7 @@ namespace XenAdmin.Actions.VMActions // Warn the user about this and ask if they want to fix it. log.Debug("VM is not agile, but protected", exn); _WarningDialogHAInvalidConfig(VM,IsStart); - new HAUnprotectVMAction(VM).RunExternal(Session); + new HAUnprotectVMAction(VM).RunSync(Session); } } diff --git a/XenModel/Folders.cs b/XenModel/Folders.cs index 325d6c7ae..ea2fdea8b 100644 --- a/XenModel/Folders.cs +++ b/XenModel/Folders.cs @@ -446,7 +446,7 @@ namespace XenAdmin.Model if (session == null) action.RunAsync(); else - action.RunExternal(session); + action.RunSync(session); } public static void Move(IXenObject ixmo, Folder target) @@ -477,7 +477,7 @@ namespace XenAdmin.Model if (session == null) action.RunAsync(); else - action.RunExternal(session); + action.RunSync(session); } public static void Unfolder(IXenObject ixmo) diff --git a/XenServerHealthCheck/XenServerHealthCheckBugTool.cs b/XenServerHealthCheck/XenServerHealthCheckBugTool.cs index f983500e1..cc08ed867 100644 --- a/XenServerHealthCheck/XenServerHealthCheckBugTool.cs +++ b/XenServerHealthCheck/XenServerHealthCheckBugTool.cs @@ -94,7 +94,7 @@ namespace XenServerHealthCheck foreach (Host host in connection.Cache.Hosts) { GetSystemStatusCapabilities action = new GetSystemStatusCapabilities(host); - action.RunExternal(session); + action.RunSync(session); if (!action.Succeeded) return; @@ -178,7 +178,7 @@ namespace XenServerHealthCheck } var statAction = new SingleHostStatusAction(host, 0, reportIncluded, filepath, timestring + "-" + ++i); - statAction.RunExternal(session); + statAction.RunSync(session); } // output the supporter/coordinator info @@ -193,7 +193,7 @@ namespace XenServerHealthCheck // Finish the collection of logs with bugtool. // Start to zip the files. ZipStatusReportAction zipAction = new ZipStatusReportAction(filepath, outputFile); - zipAction.RunExternal(session); + zipAction.RunSync(session); log.InfoFormat("Server Status Report is collected: {0}", outputFile); }