diff options
author | Simon Rettberg | 2023-05-11 14:48:06 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-05-11 14:48:06 +0200 |
commit | a5778dc6f5858c588d60483a4ac34a91be91551b (patch) | |
tree | f81033e8ab7462b08ed268beddb5f0356c7cd044 /src/main/java | |
parent | [vbox] Implement .transformPrivacy(), remove placeholder code (diff) | |
download | master-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
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualboxFileFormat.java | 8 |
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 ); |