winterhazel commented on code in PR #10632:
URL: https://github.com/apache/cloudstack/pull/10632#discussion_r2175632095


##########
core/src/main/java/com/cloud/agent/api/storage/DeleteDiskOnlyVmSnapshotCommand.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.agent.api.storage;
+
+import com.cloud.agent.api.Command;
+
+import com.cloud.agent.api.to.DataTO;
+
+
+import java.util.List;
+
+public class DeleteDiskOnlyVmSnapshotCommand extends Command {
+
+    List<DataTO> snapshots;
+
+    public DeleteDiskOnlyVmSnapshotCommand(List<DataTO> snapshots) {
+        this.snapshots = snapshots;
+    }
+
+    public List<DataTO> getSnapshots() {
+        return snapshots;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return true;

Review Comment:
   I think it would be better to have these set to `false` so that the new 
commands do not block operations of unrelated VMs.



##########
core/src/main/java/com/cloud/agent/api/storage/MergeDiskOnlyVmSnapshotCommand.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.agent.api.storage;
+
+import com.cloud.agent.api.Command;
+import com.cloud.vm.VirtualMachine;
+
+import java.util.List;
+
+public class MergeDiskOnlyVmSnapshotCommand extends Command {
+
+    private List<SnapshotMergeTreeTO> snapshotMergeTreeToList;
+    private VirtualMachine.State vmState;
+    private String vmName;
+
+    public MergeDiskOnlyVmSnapshotCommand(List<SnapshotMergeTreeTO> 
snapshotMergeTreeToList, VirtualMachine.State vmState, String vmName) {
+        this.snapshotMergeTreeToList = snapshotMergeTreeToList;
+        this.vmState = vmState;
+        this.vmName = vmName;
+    }
+
+    public List<SnapshotMergeTreeTO> getSnapshotMergeTreeToList() {
+        return snapshotMergeTreeToList;
+    }
+
+    public VirtualMachine.State getVmState() {
+        return vmState;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return true;

Review Comment:
   Same here



##########
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuImg.java:
##########
@@ -826,6 +826,46 @@ public void resize(final QemuImgFile file, final long 
size) throws QemuImgExcept
         this.resize(file, size, false);
     }
 
+    /**
+     * Commits an image.
+     *
+     * This method is a facade for 'qemu-img commit'.
+     *
+     * @param file
+     *            The file to be commited.
+     * @param base
+     *            If base is not specified, the immediate backing file of the 
top image (which is {@code file}) will be used.
+     * @param deleteFile
+     *            If true, the commited file(s) will be deleted.
+     */
+    public void commit( QemuImgFile file, QemuImgFile base, boolean 
deleteFile) throws QemuImgException {

Review Comment:
   ```suggestion
       public void commit(QemuImgFile file, QemuImgFile base, boolean 
deleteFile) throws QemuImgException {
   ```



##########
core/src/main/java/com/cloud/agent/api/storage/RevertDiskOnlyVmSnapshotCommand.java:
##########
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.agent.api.storage;
+
+import com.cloud.agent.api.Command;
+import org.apache.cloudstack.storage.to.SnapshotObjectTO;
+
+import java.util.List;
+
+public class RevertDiskOnlyVmSnapshotCommand extends Command {
+
+    private List<SnapshotObjectTO> snapshotObjectTos;
+    private String vmName;
+
+    public RevertDiskOnlyVmSnapshotCommand(List<SnapshotObjectTO> 
snapshotObjectTos, String vmName) {
+        super();
+        this.snapshotObjectTos = snapshotObjectTos;
+        this.vmName = vmName;
+    }
+
+    public List<SnapshotObjectTO> getSnapshotObjectTos() {
+        return snapshotObjectTos;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return true;

Review Comment:
   Same here



-- 
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