sureshanaparti commented on code in PR #9736:
URL: https://github.com/apache/cloudstack/pull/9736#discussion_r1778237605
##########
api/src/main/java/com/cloud/hypervisor/Hypervisor.java:
##########
@@ -23,34 +23,52 @@
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
+import java.util.Set;
+import java.util.EnumSet;
public class Hypervisor {
public static class HypervisorType {
+ public static enum Functionality {
+ DirectDownloadTemplate,
+ RootDiskSizeOverride;
+ }
+
private static final Map<String, HypervisorType> hypervisorTypeMap =
new LinkedHashMap<>();
public static final HypervisorType None = new HypervisorType("None");
//for storage hosts
- public static final HypervisorType XenServer = new
HypervisorType("XenServer", ImageFormat.VHD);
- public static final HypervisorType KVM = new HypervisorType("KVM",
ImageFormat.QCOW2);
- public static final HypervisorType VMware = new
HypervisorType("VMware", ImageFormat.OVA);
+ public static final HypervisorType XenServer = new
HypervisorType("XenServer", ImageFormat.VHD,
+ EnumSet.of(Functionality.RootDiskSizeOverride));
+ public static final HypervisorType KVM = new HypervisorType("KVM",
ImageFormat.QCOW2,
+ EnumSet.of(Functionality.DirectDownloadTemplate,
Functionality.RootDiskSizeOverride));
Review Comment:
```suggestion
EnumSet.allOf(Functionality.class));
```
can add a constructor for all func supported? (might be useful when
functionalities increase and some hypervisors support all of them - no need to
list all of them 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]