diff options
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VmMetaData.java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VmMetaData.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java index 3c1d485..46097df 100644 --- a/src/main/java/org/openslx/util/vm/VmMetaData.java +++ b/src/main/java/org/openslx/util/vm/VmMetaData.java @@ -10,6 +10,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.swing.tree.ExpandVetoException; + import org.apache.log4j.Logger; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.bwlp.thrift.iface.Virtualizer; @@ -156,7 +158,6 @@ public abstract class VmMetaData<T, U, V, W> } } - public static enum EtherType { NAT, @@ -313,18 +314,23 @@ public abstract class VmMetaData<T, U, V, W> // meta object needed when reading from configarray public static VmMetaData<?, ?, ?, ?> getInstance( List<OperatingSystem> osList, byte[] vmContent, int length ) throws IOException { + Exception errEx = null; try { return new VmwareMetaData( osList, vmContent, length ); } catch ( UnsupportedVirtualizerFormatException e ) { - LOGGER.debug( "Machine description not in .vmx format.", e ); + LOGGER.debug( "Machine description not in .vmx format." ); + errEx = e; } try { LOGGER.debug( "versuche vbox" ); return new VboxMetaData( osList, vmContent, length ); } catch ( UnsupportedVirtualizerFormatException e ) { - LOGGER.debug( "Machine description not in .vbox format.", e ); + LOGGER.debug( "Machine description not in .vbox format." ); + errEx = e; + } + if ( errEx != null ) { + LOGGER.error( "Machine description has an unknown format!", errEx ); } - LOGGER.error( "Machine description has an unknown format!" ); return null; } @@ -363,17 +369,15 @@ public abstract class VmMetaData<T, U, V, W> public abstract EthernetDevType getEthernetDevType( int cardIndex ); public abstract byte[] getDefinitionArray(); - - public abstract boolean addEthernet( EtherType type ); - public abstract void reWrite(); + public abstract boolean addEthernet( EtherType type ); public abstract Virtualizer getVirtualizer(); public abstract void enableUsb( boolean enabled ); - + public abstract boolean disableSuspend(); - + /** * * Function used by subclasses to put the virtual devices, which the subclass supports in the |