diff options
author | Manuel Bentele | 2021-01-05 13:18:19 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-01-05 13:18:19 +0100 |
commit | d255442bc41d12f685d4c0d3857f694c40560bd6 (patch) | |
tree | 59aa7ac7e40cdd1c076131d1be829207ad97acde /dozentenmodul/src/main | |
parent | [client] I18n of LocationSelector (diff) | |
download | tutor-module-d255442bc41d12f685d4c0d3857f694c40560bd6.tar.gz tutor-module-d255442bc41d12f685d4c0d3857f694c40560bd6.tar.xz tutor-module-d255442bc41d12f685d4c0d3857f694c40560bd6.zip |
[client] Add import of Libvirt XML files to support QEMU
Diffstat (limited to 'dozentenmodul/src/main')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java | 7 | ||||
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java index 19ce1429..d5202f4b 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java @@ -57,6 +57,8 @@ public class ImageUploadPage extends ImageUploadPageLayout { "vmx"); private final FileNameExtensionFilter vboxFilter = new FileNameExtensionFilter( "VirtualBox Virtual Machine", "vbox"); + private final FileNameExtensionFilter qemuFilter = new FileNameExtensionFilter( + "QEMU Virtual Machine", "xml"); private final FileNameExtensionFilter ovfFilter = new FileNameExtensionFilter( "OVF Virtual Machine Format", "ovf"); @@ -96,7 +98,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { // initialize allSupportedFilter depending on whether multiple hypervisors // are supported or not if (Session.hasFeature(Feature.MULTIPLE_HYPERVISORS)) { - allSupportedFilter = new FileNameExtensionFilter("All Supported", "vmx", "ovf", "vbox", "ova"); + allSupportedFilter = new FileNameExtensionFilter("All Supported", "vmx", "ovf", "vbox", "xml", "ova"); } else { allSupportedFilter = new FileNameExtensionFilter("All Supported", "vmx", "ovf", "ova"); } @@ -111,6 +113,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { fc.addChoosableFileFilter(ovaFilter); if (Session.hasFeature(Feature.MULTIPLE_HYPERVISORS)) { fc.addChoosableFileFilter(vboxFilter); + fc.addChoosableFileFilter(qemuFilter); } fc.addChoosableFileFilter(allSupportedFilter); fc.setFileFilter(allSupportedFilter); @@ -120,6 +123,8 @@ public class ImageUploadPage extends ImageUploadPageLayout { fc.setFileFilter(vmxFilter); } else if (existingImage.virtId.equals(TConst.VIRT_VIRTUALBOX)) { fc.setFileFilter(vboxFilter); + } else if (existingImage.virtId.equals(TConst.VIRT_QEMU)) { + fc.setFileFilter(qemuFilter); } } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java index 58093471..3f3b9fac 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java @@ -114,7 +114,7 @@ public class VmWrapper { } else if (vmMeta instanceof VboxMetaData) { fileType = ".vbox"; } else if (vmMeta instanceof QemuMetaData) { - fileType = "_startCommand.txt"; + fileType = ".xml"; } if (fileType == null) { LOGGER.warn("file type somehow unclear; application could stop working here!"); |