vishesh92 commented on code in PR #9736:
URL: https://github.com/apache/cloudstack/pull/9736#discussion_r1778332334
##########
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:
In future when new a functionality is added, this will require a change.
IMO, it's better to have it like this.
--
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]