summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/util/vm/VboxConfig.java
diff options
context:
space:
mode:
authorSimon Rettberg2021-03-05 14:16:16 +0100
committerSimon Rettberg2021-03-05 14:16:16 +0100
commit7deac91af348d53769e6371e46bcfa434b973dd5 (patch)
tree1119b56bdd1c87f2466b27cbb7b4627949909dd5 /src/main/java/org/openslx/util/vm/VboxConfig.java
parent[Json] Explicitly pass Object[] to Method.invoke() (diff)
downloadmaster-sync-shared-7deac91af348d53769e6371e46bcfa434b973dd5.tar.gz
master-sync-shared-7deac91af348d53769e6371e46bcfa434b973dd5.tar.xz
master-sync-shared-7deac91af348d53769e6371e46bcfa434b973dd5.zip
[vm] Add support for NVMe
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxConfig.java')
-rw-r--r--src/main/java/org/openslx/util/vm/VboxConfig.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxConfig.java b/src/main/java/org/openslx/util/vm/VboxConfig.java
index e9870a5..f405991 100644
--- a/src/main/java/org/openslx/util/vm/VboxConfig.java
+++ b/src/main/java/org/openslx/util/vm/VboxConfig.java
@@ -382,15 +382,18 @@ public class VboxConfig
}
String controllerMode = hddController.getAttribute( "type" );
String controllerType = hddController.getAttribute( "name" );
- DriveBusType busType = null;
- if ( controllerType.equals( "IDE" ) ) {
- busType = DriveBusType.IDE;
- } else if ( controllerType.equals( "SCSI" ) ) {
- busType = DriveBusType.SCSI;
- } else if ( controllerType.equals( "SATA" ) ) {
- busType = DriveBusType.SATA;
- } else
- continue;
+ DriveBusType busType;
+ if ( controllerType.equals( "NVMe" ) ) {
+ busType = DriveBusType.NVME;
+ } else {
+ try {
+ // This assumes the type in the xml matches our enum constants.
+ busType = DriveBusType.valueOf( controllerType );
+ } catch (Exception e) {
+ LOGGER.warn( "Skipping unknown HDD controller type '" + controllerType + "'" );
+ continue;
+ }
+ }
LOGGER.info( "Adding hard disk with controller: " + busType + " (" + controllerMode + ") from file '" + fileName + "'." );
hddsArray.add( new HardDisk( controllerMode, busType, fileName ) );
}