CA-322672: Improve comments around RDP status checks

`data/ts` indicates the VM has RDP enabled

`feature-ts2` is the feature flag indicating that `data/ts` is valid.

`feature-ts` is the feature flag indicating the toolstack can enable RDP remotely (by writing to `control/ts`)

the `network` object contains the IP info written by the `xenvif` driver (which needs a 1st reboot to swap out the emulated network adapter)

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2022-03-30 08:57:53 +01:00
parent 05ba1ce8a0
commit d17b99e6b0
No known key found for this signature in database
GPG Key ID: 55F556F9A25CB037
2 changed files with 7 additions and 6 deletions

View File

@ -1093,7 +1093,7 @@ namespace XenAdmin.ConsoleView
{
log.DebugFormat("RDP detected for VM '{0}'", source == null ? "unknown/null" : source.name_label);
toggleToXVNCorRDP = RDP;
if (vncScreen.UseVNC)
toggleConsoleButton.Text = CanEnableRDP() ? enableRDP : UseRDP;

View File

@ -348,7 +348,8 @@ namespace XenAPI
var metrics = Connection.Resolve(this.guest_metrics);
if (metrics == null)
return false;
// feature-ts is the feature flag indicating the toolstack
// can enable RDP remotely (by writing to control/ts)
return 0 != IntKey(metrics.other, "feature-ts", 0);
}
@ -357,7 +358,7 @@ namespace XenAPI
var vmMetrics = Connection.Resolve(this.guest_metrics);
if (vmMetrics == null)
return false;
// data/ts indicates the VM has RDP enabled
return 0 != IntKey(vmMetrics.other, "data-ts", 0);
}
@ -366,7 +367,7 @@ namespace XenAPI
var metrics = Connection.Resolve(this.guest_metrics);
if (metrics == null)
return false;
// feature-ts2 is the feature flag indicating that data/ts is valid
return 0 != IntKey(metrics.other, "feature-ts2", 0);
}
@ -380,8 +381,8 @@ namespace XenAPI
IntKey(guestMetrics.other, "feature-ts", 0) != 0 &&
IntKey(guestMetrics.other, "data-ts", 0) != 0 &&
// CA-322672: Can't connect using RDP if there are no networks.
// Also, this value is empty before the reboot required
// after installing VM Tools on a Windows VM
// The network object contains the IP info written by the xenvif
// driver (which needs a 1st reboot to swap out the emulated network adapter)
guestMetrics.networks.Count > 0;
}