Omer Frenkel has uploaded a new change for review.

Change subject: core: add 'Comment' field to OVF
......................................................................

core: add 'Comment' field to OVF

'Comment' is missing from the OVF, therfore, missing from snapshots,
import-export and also not working when editing running vm.

this patch add the fields to the OVF and solving all above.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1128446
Change-Id: I79fdcfd10d2bd510b57314f330f349b38e6f5ee2
Signed-off-by: Omer Frenkel <[email protected]>
---
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/OvfWriter.java
3 files changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/66/31666/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 db9d012..8a013b2 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
@@ -68,4 +68,5 @@
     final static String IS_BOOT_MENU_ENABLED = "IsBootMenuEnabled";
     final static String IS_SPICE_FILE_TRANSFER_ENABLED = 
"IsSpiceFileTransferEnabled";
     final static String IS_SPICE_COPY_PASTE_ENABLED = 
"IsSpiceCopyPasteEnabled";
+    final static String COMMENT = "Comment";
 }
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 35f9c6a..60e5f1f 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
@@ -445,6 +445,11 @@
             vmBase.setDescription(node.innerText);
         }
 
+        node = content.SelectSingleNode(OvfProperties.COMMENT);
+        if (node != null) {
+            vmBase.setComment(node.innerText);
+        }
+
         node = content.SelectSingleNode(OvfProperties.DOMAIN);
         if (node != null) {
             vmBase.getVmInit().setDomain(node.innerText);
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfWriter.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfWriter.java
index dab9c0e..02e0ef6 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfWriter.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfWriter.java
@@ -237,6 +237,10 @@
         _writer.WriteRaw(vmBase.getDescription());
         _writer.WriteEndElement();
 
+        _writer.WriteStartElement(OvfProperties.COMMENT);
+        _writer.WriteRaw(vmBase.getComment());
+        _writer.WriteEndElement();
+
         if (!vmInitEnabled() && vmBase.getVmInit() != null && 
vmBase.getVmInit().getDomain() != null) {
             _writer.WriteStartElement(OvfProperties.DOMAIN);
             _writer.WriteRaw(vmBase.getVmInit().getDomain());


-- 
To view, visit http://gerrit.ovirt.org/31666
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79fdcfd10d2bd510b57314f330f349b38e6f5ee2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to