DaanHoogland commented on code in PR #13835:
URL: https://github.com/apache/cloudstack/pull/13835#discussion_r3756078435
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java:
##########
@@ -2339,33 +2339,51 @@ private CreateObjectAnswer
takeClvmVolumeSnapshotOfStoppedVm(KVMPhysicalDisk dis
* barriers properly (>2.6.32) this won't be any different then pulling
the power
* cord out of a running machine.
*/
- private Long takeRbdVolumeSnapshotOfStoppedVm(KVMStoragePool primaryPool,
KVMPhysicalDisk disk, String snapshotName) {
+ protected Long takeRbdVolumeSnapshotOfStoppedVm(KVMStoragePool
primaryPool, KVMPhysicalDisk disk, String snapshotName) {
Long snapshotSize = null;
+ Rados r = null;
+ IoCTX io = null;
+ Rbd rbd = null;
+ RbdImage image = null;
try {
- Rados r = radosConnect(primaryPool);
+ r = radosConnect(primaryPool);
- final IoCTX io = r.ioCtxCreate(primaryPool.getSourceDir());
- final Rbd rbd = new Rbd(io);
- final RbdImage image = rbd.open(disk.getName());
+ io = r.ioCtxCreate(primaryPool.getSourceDir());
+ rbd = new Rbd(io);
+ image = rbd.open(disk.getName());
Review Comment:
yes, reads better. I would personally still give the snapprotect block a
separate method as well. But this looks good as is, tnx.
--
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]