Moti Asayag has uploaded a new change for review. Change subject: engine: Read vnic profile name from the OVF ......................................................................
engine: Read vnic profile name from the OVF The patch assign the vnic profile name from the OVF as read from OtherResourceType element to the VmNetworkInterface entity so it could be handled when the vm or template are being imported. Change-Id: I284e5bdecbd0bc6d47a1bead27ac378169e1ad42 Signed-off-by: Moti Asayag <masa...@redhat.com> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java 3 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/39/17439/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java index 2834316..78c25db 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfProperties.java @@ -7,6 +7,7 @@ final static String VMD_ADDRESS = "rasd:Address"; final static String VMD_NAME = "rasd:Name"; final static String VMD_CONNECTION = "rasd:Connection"; + final static String VMD_VNIC_PROFILE_NAME = "rasd:OtherResourceType"; final static String VMD_LINKED = "rasd:Linked"; final static String VMD_RESOURCE_TYPE = "rasd:ResourceType"; final static String VMD_SUB_RESOURCE_TYPE = "rasd:ResourceSubType"; diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java index 0a0f500..ddc50c5 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java @@ -508,6 +508,10 @@ String networkName = node.SelectSingleNode(OvfProperties.VMD_CONNECTION, _xmlNS).InnerText; iface.setNetworkName(StringUtils.defaultIfEmpty(networkName, null)); + XmlNode vnicProfileNameNode = node.SelectSingleNode(OvfProperties.VMD_VNIC_PROFILE_NAME, _xmlNS); + iface.setVnicProfileName(vnicProfileNameNode == null ? null + : StringUtils.defaultIfEmpty(vnicProfileNameNode.InnerText, null)); + XmlNode linkedNode = node.SelectSingleNode(OvfProperties.VMD_LINKED, _xmlNS); iface.setLinked(linkedNode == null ? true : Boolean.valueOf(linkedNode.InnerText)); diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java index aecb626..42682b6 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java @@ -110,6 +110,10 @@ String resourceSubNetworkName = node.SelectSingleNode(OvfProperties.VMD_CONNECTION, _xmlNS).InnerText; iface.setNetworkName(StringUtils.defaultIfEmpty(resourceSubNetworkName, null)); + XmlNode vnicProfileNameNode = node.SelectSingleNode(OvfProperties.VMD_VNIC_PROFILE_NAME, _xmlNS); + iface.setVnicProfileName(vnicProfileNameNode == null ? null + : StringUtils.defaultIfEmpty(vnicProfileNameNode.InnerText, null)); + XmlNode linkedNode = node.SelectSingleNode(OvfProperties.VMD_LINKED, _xmlNS); iface.setLinked(linkedNode == null ? true : Boolean.valueOf(linkedNode.InnerText)); iface.setName(node.SelectSingleNode("rasd:Name", _xmlNS).InnerText); -- To view, visit http://gerrit.ovirt.org/17439 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I284e5bdecbd0bc6d47a1bead27ac378169e1ad42 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches