GutoVeronezi commented on code in PR #6422:
URL: https://github.com/apache/cloudstack/pull/6422#discussion_r884991838
##########
scripts/storage/qcow2/managesnapshot.sh:
##########
@@ -226,14 +226,48 @@ backup_snapshot() {
return 2
fi
elif [ -f ${disk} ]; then
+ if [[ $disk == *"/snapshots/"* ]]; then
+ #Backup volume snapshot
+ cp "$disk" "${destPath}/${destName}"
+ ret_code=$?
- cp "$disk" "${destPath}/${destName}"
- ret_code=$?
+ if [ $ret_code -gt 0 ]
+ then
+ printf "Failed to backup $snapshotname for disk $disk to $destPath\n"
>&2
+ return 2
+ fi
+ else
+ # Backup VM snapshot
+ qemuimg_ret=$($qemu_img snapshot $forceShareFlag -l $disk 2>&1)
Review Comment:
@weizhouapache, as this is a fix of PR #5297 (specifically this commit:
https://github.com/apache/cloudstack/pull/5297/commits/f5180ddb854e5953c57113c0f2f5690c894050ac),
and I'm only returning the removed code to VM snapshots, I'd rather not
refactoring anything right now.
In other hand, this entire script could be removed and the workflow
implemented via Java, with documentation and unit tests. We could create an
issue to do this in the future. What do you think?
--
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]