* CP-19605: Improve the performance of the CreateNewRootNode function
Make GroupKey a class and override GetHashCode and Equals
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
* CP-19605: Remove debugging lines
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
Also changed ApplyPatchAction and ApplyUpdateAction to install a single update to a single host, so that the appropriate action title can be displayed if an action fails. And replaced 2 hardcoded strings with resource strings.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
When working on this ticket (see previous commit), I noticed that the WebClient object used in DownloadAndUnzipXenServerPatchAction did not use XenCenter's proxy settings. This commit fixes this issue. By default (with no proxy being set) the proxy variable will be null as expected.
Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
Using standard .NET Framework functionality instead of the custom implementation of the HTTP stack. (To download a single file.)
Note that this .net class WebClient is already being used to download hotfixes. However, in that code the proxy is not set, I am fixing that in a new commit on the same ticket.
Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
* CA-236844: XenCenter throws "Assertion failed" error when toggling between the RDP and VNC consoles
Couldn't reproduce it, but it looks like the assertion is hit because the console view still holds a subscription to an event from an old vnc stream (maybe not garbage collected yet).
Added code to deregister event handlers when the vcnStream is disconnected and also replaced the the assertion with an if statement, ignoring the case that might have caused the assertion failure.
* CA-236844: XenCenter throws "Assertion failed" error when toggling between the RDP and VNC consoles
Added a Debug assert and a null check.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
Implemented a generic mechanism to allow tab pages to unregister their event handlers when they are hidden (when a tab page gets deselected)
Also changed VMStoragePage to derive from BaseTabPage, so it could use the same mechanism.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
Disabled the ability to select unreachable hosts and in addition
added a try/catch block to hide error message resulting from trying
to clean up an unreachable host.
Signed-off-by: Letsibogo Ramadi <letsibogo.ramadi@citrix.com>
For ElyOrGreater hosts, we try move the existing VIFs to the desired networks. We will only destroy and create new ones for older hosts or when a corresponding VIF cannot be found in the network mapping.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
These lists were continuously growing on each refresh, because the Where
clauses returned all items as the predicate was always evaluated to
true. The reason is: A. Even IEquatable<XenServerPatch> is
implemented on XenServerPatch, it only compares uuids. B. XenServerVersion
(also XenCenterversion) does not implement Equals (always different as the
Action returns new objects).
The two bugs these caused are: A] forever growing list of versions causing
obsolete data to be kept while everything is added to the end of the list
additionally. B] Any previously added Patch will not be updated unless the uuid has been changed (this never changes).
Fix in this commit: On each refresh, taking the new lists as they are
(from the Action) and not trying to keep or modify existing items. GC will do the rest with the old list (and objects)
Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
Added "VM.pool_migrate" to the list of tasks suitable for meddling actions.
Removed the usage of MeddlingActionTitle other_config key, because it wasn't working as intended for two reasons:
- If XenCenter starts an action that does multiple async api calls, so multiple tasks, the action's title is assigned to all tasks as MeddlingActionTitles, so the second XenCenter instance would create multiple meddling actions with the same title.
- When a second XenCenter instance tries to see if a task is suitable for a meddling action, the MeddlingActionTitle is not yet present in the task's other_config, so the task is ignored in most of the cases.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>