Skip to content

Commit

Permalink
CA-286293: OVF export missing the recommendations field (xenserver#2019)
Browse files Browse the repository at this point in the history
* CA-286293: OVF export missing the recommendations field

Signed-off-by: Jisheng Xing <[email protected]>

* fix review comment
  • Loading branch information
jishengx authored and kc284 committed Apr 3, 2018
1 parent 587144d commit 6c43263
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions XenOvfTransport/Export.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@ private EnvelopeType _export(Session xenSession, string targetPath, string ovfna
OVF.AddOtherSystemSettingData(ovfEnv, vsId, "hardware_platform_version", vm.hardware_platform_version.ToString(), OVF.GetContentMessage("OTHER_SYSTEM_SETTING_DESCRIPTION_1"));
}

if (vm.HasSriovRecommendation())
if (!string.IsNullOrEmpty(vm.recommendations))
{
OVF.AddOtherSystemSettingData(ovfEnv, vsId, "allow_network_sriov", bool.TrueString.ToLowerInvariant(), OVF.GetContentMessage("OTHER_SYSTEM_SETTING_DESCRIPTION_1"));
OVF.AddOtherSystemSettingData(ovfEnv, vsId, "recommendations", vm.recommendations.ToString(), OVF.GetContentMessage("OTHER_SYSTEM_SETTING_DESCRIPTION_1"));
}

if (vm.has_vendor_device)
{
//serialise it with a different name to avoid it being deserialised automatically and getting the wrong type
Expand Down

0 comments on commit 6c43263

Please sign in to comment.