wido commented on a change in pull request #3724: Storage-based Snapshots for 
KVM VMs
URL: https://github.com/apache/cloudstack/pull/3724#discussion_r366278579
 
 

 ##########
 File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
 ##########
 @@ -947,25 +953,57 @@ public Answer backupSnapshot(final CopyCommand cmd) {
                     return new CopyCmdAnswer(e.toString());
                 }
             } else {
-                final Script command = new Script(_manageSnapshotPath, 
cmd.getWaitInMillSeconds(), s_logger);
-                command.add("-b", snapshotDisk.getPath());
-                command.add("-n", snapshotName);
-                command.add("-p", snapshotDestPath);
-                if (isCreatedFromVmSnapshot) {
-                    descName = UUID.randomUUID().toString();
-                }
-                command.add("-t", descName);
-                final String result = command.execute();
-                if (result != null) {
-                    s_logger.debug("Failed to backup snaptshot: " + result);
-                    return new CopyCmdAnswer(result);
-                }
-                final File snapFile = new File(snapshotDestPath + "/" + 
descName);
-                if(snapFile.exists()){
-                    size = snapFile.length();
+                if (isKVMEnabled) {
+                    OutputInterpreter.OneLineParser parser = new 
OutputInterpreter.OneLineParser();
+                    Script sc = new Script("virsh");
+                    sc.add(String.format("qemu-monitor-command %s '{ 
\"execute\" : \"query-block-jobs\" }'", vmName));
 
 Review comment:
   This can also be executed through libvirt's Java bindings and we should not 
do this through a separate command.
   
   Avoid any execution from Java as it's unreliable.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to