diff options
author | Victor Mocanu | 2017-12-15 16:25:35 +0100 |
---|---|---|
committer | Victor Mocanu | 2017-12-15 16:25:35 +0100 |
commit | aa9e3a1882ac4fefda196307b7bbbad7c5904297 (patch) | |
tree | 56f54c7162e574c67332fe1a64a0a7384449705a /src/main/java/org/openslx/util/vm/VboxMetaData.java | |
parent | [VBox] added MACAddress placeholder (diff) | |
download | master-sync-shared-aa9e3a1882ac4fefda196307b7bbbad7c5904297.tar.gz master-sync-shared-aa9e3a1882ac4fefda196307b7bbbad7c5904297.tar.xz master-sync-shared-aa9e3a1882ac4fefda196307b7bbbad7c5904297.zip |
[VBox] implemented the addfloppy method
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxMetaData.java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VboxMetaData.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxMetaData.java b/src/main/java/org/openslx/util/vm/VboxMetaData.java index 0b0e0d8..625f11f 100644 --- a/src/main/java/org/openslx/util/vm/VboxMetaData.java +++ b/src/main/java/org/openslx/util/vm/VboxMetaData.java @@ -11,6 +11,7 @@ import org.apache.log4j.Logger; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.bwlp.thrift.iface.Virtualizer; import org.w3c.dom.Element; +import org.w3c.dom.Node; class VBoxSoundCardMeta { @@ -210,11 +211,39 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, @Override public void addFloppy( int index, String image, boolean readOnly ) { - // TODO will need to add this soon + + 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" ); + controller.setAttribute( "PortCount", "1" ); + controller.setAttribute( "useHostIOCache", "true" ); + controller.setAttribute( "Bootable", "true" ); + } + 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 ) ); + 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 ) ); + + Element imageTag = (Element)config.addNewNode( "AttachedDevice", "Image", true, "type", "Floppy" ); + imageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); + config.addNewNode( "MediaRegistry", "FloppyImages", false ); + Element floppyImageTag = (Element)config.addNewNode( "FloppyImages", "Image", true ); + floppyImageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); + floppyImageTag.setAttribute( "location", "#OpenSLX_FloppyImageLocation_place_holder" ); } - } @Override |