abh1sar commented on code in PR #9666:
URL: https://github.com/apache/cloudstack/pull/9666#discussion_r1828980905


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -470,16 +468,30 @@ public List<BackupSchedule> listBackupSchedule(final Long 
vmId) {
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_VM_BACKUP_SCHEDULE_DELETE, 
eventDescription = "deleting VM backup schedule")
-    public boolean deleteBackupSchedule(final Long vmId) {
-        final VMInstanceVO vm = findVmById(vmId);
-        validateForZone(vm.getDataCenterId());
-        accountManager.checkAccess(CallContext.current().getCallingAccount(), 
null, true, vm);
+    public boolean deleteBackupSchedule(DeleteBackupScheduleCmd cmd) {
+        Long vmId = cmd.getVmId();
+        Long id = cmd.getId();

Review Comment:
   In DeleteBackupScheduleCmd, both vmId and id parameters are declared with 
required = true, but here it looks like either of them could be null.



##########
scripts/vm/hypervisor/kvm/nasbackup.sh:
##########
@@ -99,7 +151,16 @@ delete_backup() {
 mount_operation() {
   mount_point=$(mktemp -d -t csbackup.XXXXX)
   dest="$mount_point/${BACKUP_DIR}"
-  mount -t ${NAS_TYPE} ${NAS_ADDRESS} ${mount_point} $([[ ! -z "${MOUNT_OPTS}" 
]] && echo -o ${MOUNT_OPTS})
+  if [ ${NAS_TYPE} == "cifs" ]; then
+    MOUNT_OPTS="${MOUNT_OPTS},nobrl"

Review Comment:
   nobrl is added in mountBackupDirectory. Is it required here as well?



##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -373,8 +375,12 @@ public Map<VirtualMachine, Backup.Metric> 
getBackupMetrics(Long zoneId, List<Vir
             Long vmBackupSize = 0L;
             Long vmBackupProtectedSize = 0L;
             for (final Backup backup: backupDao.listByVmId(null, vm.getId())) {
-                vmBackupSize += backup.getSize();
-                vmBackupProtectedSize += backup.getProtectedSize();
+                if (Objects.nonNull(backup.getSize())) {

Review Comment:
   can these be null?



##########
api/src/main/java/org/apache/cloudstack/api/command/user/backup/DeleteBackupScheduleCmd.java:
##########
@@ -58,6 +59,14 @@ public class DeleteBackupScheduleCmd  extends BaseCmd {
             description = "ID of the VM")
     private Long vmId;
 
+    @Parameter(name = ApiConstants.ID,
+            type = CommandType.UUID,
+            entityType = BackupScheduleResponse.class,
+            required = true,

Review Comment:
   Are both of the parameters vmId and Id mandatory? Or are they mutually 
exclusive.



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to