summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-06-18 17:35:29 +0200
committerSimon Rettberg2019-06-18 17:35:29 +0200
commitbd634872ce2c22d71032d4e032e00cad9db8b8c0 (patch)
treefbb8454e9f1b4a822bfcc5162e1f46348437b4e1
parent[client] Clean up imports (diff)
downloadtutor-module-bd634872ce2c22d71032d4e032e00cad9db8b8c0.tar.gz
tutor-module-bd634872ce2c22d71032d4e032e00cad9db8b8c0.tar.xz
tutor-module-bd634872ce2c22d71032d4e032e00cad9db8b8c0.zip
Adapt to changes regarding USB speed settings
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
index 9bae8009..953a6651 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
@@ -32,6 +32,7 @@ import org.openslx.util.Json;
import org.openslx.util.Util;
import org.openslx.util.vm.UnsupportedVirtualizerFormatException;
import org.openslx.util.vm.VmMetaData;
+import org.openslx.util.vm.VmMetaData.UsbSpeed;
import com.google.gson.JsonParseException;
@@ -557,7 +558,7 @@ public class DbLecture {
String lectureName;
String osKeyword;
boolean usbAccess;
- VmMetaData<?, ?, ?, ?> meta = null;
+ VmMetaData<?, ?, ?, ?, ?> meta = null;
try (MysqlConnection connection = Database.getConnection()) {
// Get required data about lecture and used image
MysqlStatement stmt = connection.prepareStatement("SELECT"
@@ -608,7 +609,9 @@ public class DbLecture {
}
meta.addHddTemplate("%VM_DISK_PATH%", "%VM_DISK_MODE%", "%VM_DISK_REDOLOGDIR%");
meta.addEthernet(VmMetaData.EtherType.NAT); // TODO: Use config
- meta.enableUsb(usbAccess);
+ if (!usbAccess) {
+ meta.setMaxUsbSpeed(UsbSpeed.NONE);
+ }
meta.disableSuspend();
return retval;
}
@@ -706,7 +709,7 @@ public class DbLecture {
}
public static class LaunchData {
- public VmMetaData<?, ?, ?, ?> vmx;
+ public VmMetaData<?, ?, ?, ?, ?> vmx;
public List<NetShare> netShares;
public String legacyRunScript;
public List<RunScript> runScript;