summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/util/vm/VboxConfig.java
diff options
context:
space:
mode:
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" );