diff options
author | Victor Mocanu | 2017-12-19 13:02:18 +0100 |
---|---|---|
committer | Victor Mocanu | 2017-12-19 13:02:18 +0100 |
commit | 00dc84be837bba2dd7bbc28f1d8f7c6e5fc05cc8 (patch) | |
tree | e490ef6a52b64872e3d36baf3a5a5e2751c05bcc /src/main/java/org/openslx/util/vm/VboxMetaData.java | |
parent | [VBox] implemented the addfloppy method (diff) | |
download | master-sync-shared-00dc84be837bba2dd7bbc28f1d8f7c6e5fc05cc8.tar.gz master-sync-shared-00dc84be837bba2dd7bbc28f1d8f7c6e5fc05cc8.tar.xz master-sync-shared-00dc84be837bba2dd7bbc28f1d8f7c6e5fc05cc8.zip |
[VBox] added new placeholder, improved the addUsb function
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxMetaData.java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VboxMetaData.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxMetaData.java b/src/main/java/org/openslx/util/vm/VboxMetaData.java index 625f11f..1110e2f 100644 --- a/src/main/java/org/openslx/util/vm/VboxMetaData.java +++ b/src/main/java/org/openslx/util/vm/VboxMetaData.java @@ -184,6 +184,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, public boolean addDefaultNat() { config.addNewNode( "Adapter", "NAT", true ); + config.changeAttribute( "Adapter", "MACAddress", "080027B86D12" ); return true; } @@ -214,7 +215,6 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, Node somenode = config.findANode( "StorageController", "name", "Floppy" ); if ( somenode == null ) { - LOGGER.debug( "somenode is null" ); Element controller = (Element)config.addNewNode( "StorageControllers", "StorageController", false ); controller.setAttribute( "name", "Floppy" ); controller.setAttribute( "type", "I82078" ); @@ -223,19 +223,13 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, controller.setAttribute( "Bootable", "true" ); } + Element attachedDev = null; + if ( image == null ) { - Element attachedDev = (Element)config.addNewNode( "StorageController", "AttachedDevice", true, "name", "Floppy" ); - attachedDev.setAttribute( "type", "Floppy" ); - attachedDev.setAttribute( "hotpluggable", "false" ); - attachedDev.setAttribute( "port", "0" ); - attachedDev.setAttribute( "device", Integer.toString( index ) ); + attachedDev = (Element)config.addNewNode( "StorageController", "AttachedDevice", true, "name", "Floppy" ); LOGGER.warn( "Floppy controller has no image attached" ); } else { - Element attachedDev = (Element)config.addNewNode( "StorageController", "AttachedDevice", false, "name", "Floppy" ); - attachedDev.setAttribute( "type", "Floppy" ); - attachedDev.setAttribute( "hotpluggable", "false" ); - attachedDev.setAttribute( "port", "0" ); - attachedDev.setAttribute( "device", Integer.toString( index ) ); + attachedDev = (Element)config.addNewNode( "StorageController", "AttachedDevice", false, "name", "Floppy" ); Element imageTag = (Element)config.addNewNode( "AttachedDevice", "Image", true, "type", "Floppy" ); imageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); @@ -244,6 +238,11 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, floppyImageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); floppyImageTag.setAttribute( "location", "#OpenSLX_FloppyImageLocation_place_holder" ); } + + attachedDev.setAttribute( "type", "Floppy" ); + attachedDev.setAttribute( "hotpluggable", "false" ); + attachedDev.setAttribute( "port", "0" ); + attachedDev.setAttribute( "device", Integer.toString( index ) ); } @Override |