From 5844021bd5ab4377b59cacd26ac4c277888d2a70 Mon Sep 17 00:00:00 2001 From: Victor Mocanu Date: Tue, 21 Nov 2017 16:51:21 +0100 Subject: [VBox] added USB to the blacklist --- src/main/java/org/openslx/util/vm/VboxConfig.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/openslx/util/vm/VboxConfig.java b/src/main/java/org/openslx/util/vm/VboxConfig.java index e775cd0..94211d0 100644 --- a/src/main/java/org/openslx/util/vm/VboxConfig.java +++ b/src/main/java/org/openslx/util/vm/VboxConfig.java @@ -50,7 +50,7 @@ public class VboxConfig private ArrayList hddsArray = new ArrayList(); // a black list of sorts of tags that need to be removed from the .vbox file - private static String[] blackList = { "ExtraData", "Adapter", "GuestProperties", "LPT", "StorageController", "FloppyImages", "DVDImages", "AttachedDevice" }; + private static String[] blackList = { "USB", "ExtraData", "Adapter", "GuestProperties", "LPT", "StorageController", "FloppyImages", "DVDImages", "AttachedDevice" }; /** * constructor with input xml file @@ -399,11 +399,12 @@ public class VboxConfig return newNode; } - + /** - * usb 2.0 will be enabled + * usb 2.0 will be enabled */ - public void enableUsb(){ + public void enableUsb() + { Node newUsbNode = addNewNode( "Hardware", "USB", false ); Node newUsbControllers = addNewNode( "USB", "Controllers", false ); Node controller1 = addNewNode( "Controllers", "Controller", true ); @@ -413,14 +414,16 @@ public class VboxConfig addAttributeToNode( controller2, "name", "EHCI" ); addAttributeToNode( controller2, "type", "EHCI" ); } - + /** * disable usb by removing the USB tag */ - public void disableUsb() { + public void disableUsb() + { Node usb = findANode( "USB" ).item( 0 ); removeNode( usb ); } + // function removes a given child and the format childNode private void removeNode( Node node ) { -- cgit v1.2.3-55-g7522