summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/util/vm/VboxConfig.java
diff options
context:
space:
mode:
authorJonathan Bauer2018-04-17 15:55:26 +0200
committerJonathan Bauer2018-04-17 15:55:26 +0200
commitc3c0c248cc701af1d44f85277aa0fc96ff6b77c8 (patch)
treefbb4d83160b01c51b9ce46f3e2e3e16a99ee55fd /src/main/java/org/openslx/util/vm/VboxConfig.java
parent[vbox] add support for VirtualBox (diff)
downloadmaster-sync-shared-c3c0c248cc701af1d44f85277aa0fc96ff6b77c8.tar.gz
master-sync-shared-c3c0c248cc701af1d44f85277aa0fc96ff6b77c8.tar.xz
master-sync-shared-c3c0c248cc701af1d44f85277aa0fc96ff6b77c8.zip
[vbox] reworked VDI disk validation
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxConfig.java')
-rw-r--r--src/main/java/org/openslx/util/vm/VboxConfig.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxConfig.java b/src/main/java/org/openslx/util/vm/VboxConfig.java
index 99ef5be..7440b1d 100644
--- a/src/main/java/org/openslx/util/vm/VboxConfig.java
+++ b/src/main/java/org/openslx/util/vm/VboxConfig.java
@@ -256,6 +256,11 @@ public class VboxConfig
// take the uuid
String uuid = hddElement.getAttribute( "uuid" );
// search in the xml object and give back the parent of the parent of the node that is called Image and has the given uuid
+ String type = hddElement.getAttribute( "type" );
+ if ( !type.equals( "Normal" ) && !type.equals( "Writethrough" ) ) {
+ LOGGER.warn( "Type of the disk file is neither 'Normal' nor 'Writethrough' but: " + type );
+ LOGGER.warn( "This makes the image not directly modificable, which might lead to problems when editing it locally." );
+ }
String pathToParent = givePathToStorageController( uuid );
XPathExpression attachedDevicesExpr = xPath.compile( pathToParent );
Object devicesResult = attachedDevicesExpr.evaluate( this.doc, XPathConstants.NODESET );
@@ -265,6 +270,10 @@ public class VboxConfig
LOGGER.error( "There can not be more HDDs with the same UUID!" );
return;
}
+ if ( devicesNodes.getLength() == 0 ) {
+ LOGGER.error( "Image with UUID '" + uuid + "' does not seem connected to any storage controller. Is it a snapshot?" );
+ return;
+ }
Element deviceElement = (Element)devicesNodes.item( 0 );
String controllerDevice = deviceElement.getAttribute( "type" );
String bus = deviceElement.getAttribute( "name" );