weizhouapache commented on a change in pull request #3724:
URL: https://github.com/apache/cloudstack/pull/3724#discussion_r671030918
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
##########
@@ -1525,22 +1606,62 @@ public Answer createSnapshot(final CreateObjectCommand
cmd) {
final KVMPhysicalDisk disk =
storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(),
primaryStore.getUuid(), volume.getPath());
if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING &&
!primaryPool.isExternalSnapshot()) {
final String vmUuid = vm.getUUIDString();
- final Object[] args = new Object[] {snapshotName, vmUuid};
- final String snapshot = SnapshotXML.format(args);
+ boolean isKVMEnabled = cmd.getContextParam("kvmsnapshot") !=
null ? Boolean.parseBoolean(cmd.getContextParam("kvmsnapshot")) : false;
+ s_logger.debug(String.format("Snapshots on KVM is enabled %s",
isKVMEnabled));
+ if (isKVMEnabled) {
+ long size = 0;
+ String queryBlockResult = vm.qemuMonitorCommand(new
Gson().toJson(QemuCommand.executeQemuCommand(QemuCommand.QEMU_BLOCK,
null)).toString(), 0);
+ String path = disk.getPath();
+ String snapshotDestPath = primaryPool.getLocalPath() +
File.separator + "tmp";
+ if (queryBlockResult != null) {
Review comment:
@slavkap it is better to use
org.apache.commons.lang.StringUtils.isNotBlank in line 1616 (queryBlockResult)
and line 1618 (deviceName)
--
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]