summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-05-11 14:48:06 +0200
committerSimon Rettberg2023-05-11 14:48:06 +0200
commita5778dc6f5858c588d60483a4ac34a91be91551b (patch)
treef81033e8ab7462b08ed268beddb5f0356c7cd044
parent[vbox] Implement .transformPrivacy(), remove placeholder code (diff)
downloadmaster-sync-shared-a5778dc6f5858c588d60483a4ac34a91be91551b.tar.gz
master-sync-shared-a5778dc6f5858c588d60483a4ac34a91be91551b.tar.xz
master-sync-shared-a5778dc6f5858c588d60483a4ac34a91be91551b.zip
vbox: Add special case for older vbox version files
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java
index c0fe62b..570b597 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java
@@ -287,7 +287,13 @@ public class VirtualizationConfigurationVirtualboxFileFormat
private void removeUnusedHdds()
{
Set<String> existing = new HashSet<>();
- NodeList list = findNodes( "/VirtualBox/Machine/Hardware/StorageControllers/StorageController/AttachedDevice/Image" );
+ String path;
+ if ( this.getVersion().isSmallerThan( Version.valueOf( "1.17" ) ) ) {
+ path = "/VirtualBox/Machine/StorageControllers/StorageController/AttachedDevice/Image";
+ } else {
+ path = "/VirtualBox/Machine/Hardware/StorageControllers/StorageController/AttachedDevice/Image";
+ }
+ NodeList list = findNodes( path );
if ( list != null && list.getLength() != 0 ) {
for ( int i = 0; i < list.getLength(); ++i ) {
Node item = list.item( i );