slavkap commented on a change in pull request #5297:
URL: https://github.com/apache/cloudstack/pull/5297#discussion_r686963157



##########
File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
##########
@@ -1497,8 +1475,43 @@ public Answer createVolume(final CreateObjectCommand 
cmd) {
         }
     }
 
-    protected static final MessageFormat SnapshotXML = new MessageFormat("   
<domainsnapshot>" + "       <name>{0}</name>" + "          <domain>"
-            + "            <uuid>{1}</uuid>" + "        </domain>" + "    
</domainsnapshot>");
+    /**
+     * XML to take disk-only snapshot of the VM.<br><br>
+     * 1st parameter: snapshot's name;<br>
+     * 2nd parameter: disk's label (target.dev tag from VM's XML);<br>
+     * 3rd parameter: absolute path to create the snapshot;<br>
+     * 4th parameter: list of disks to avoid on snapshot {@link 
#TAG_AVOID_DISK_FROM_SNAPSHOT};
+     */
+    private static final String XML_CREATE_SNAPSHOT = 
"<domainsnapshot><name>%s</name><disks><disk name='%s' 
snapshot='external'><source file='%s'/></disk>%s</disks>"
+      + "</domainsnapshot>";
+
+    /**
+     * Tag to avoid disk from snapshot.<br><br>
+     * 1st parameter: disk's label (target.dev tag from VM's XML);
+     */
+    private static final String TAG_AVOID_DISK_FROM_SNAPSHOT = "<disk 
name='%s' snapshot='no' />";
+
+    /**
+     * Virsh command to merge (blockcommit) snapshot into the base 
file.<br><br>
+     * 1st parameter: VM's name;<br>
+     * 2nd parameter: disk's label (target.dev tag from VM's XML);<br>
+     * 3rd parameter: the absolute path of the base file;
+     */
+    private static final String COMMAND_MERGE_SNAPSHOT = "virsh blockcommit %s 
%s --base %s --active --wait --delete --pivot";

Review comment:
       I spoke offline with @GutoVeronezi, and the flag `--delete` does not 
work with the version of libvirt that I have
   
   ```
   Using library: libvirt 5.0.0
   Using API: QEMU 5.0.0
   Running hypervisor: QEMU 2.12.0
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to