diff options
author | Simon Rettberg | 2019-06-19 18:57:38 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-06-19 18:57:38 +0200 |
commit | 6fcaab3759aa9c8cfd20f6e077f165d025a1a658 (patch) | |
tree | 728b82828dc03b62853d38e9b99b1a9745c99d55 /src/main/java/org/openslx/util/vm/VboxConfig.java | |
parent | Add support for configuring USB speed (diff) | |
download | master-sync-shared-6fcaab3759aa9c8cfd20f6e077f165d025a1a658.tar.gz master-sync-shared-6fcaab3759aa9c8cfd20f6e077f165d025a1a658.tar.xz master-sync-shared-6fcaab3759aa9c8cfd20f6e077f165d025a1a658.zip |
[vm] Turn disableSuspend into more versatile tweakForNonPersistent
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxConfig.java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VboxConfig.java | 19 |
1 files changed, 19 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 5f2a21d..e9870a5 100644 --- a/src/main/java/org/openslx/util/vm/VboxConfig.java +++ b/src/main/java/org/openslx/util/vm/VboxConfig.java @@ -533,6 +533,25 @@ public class VboxConfig } return (Element)nn; } + + public void setExtraData( String key, String value ) + { + NodeList nl = findNodes( "/VirtualBox/Machine/ExtraData/ExtraDataItem[@name='" + key + "']" ); + Element e = null; + for ( int i = 0; i < nl.getLength(); ++i ) { + Node n = nl.item( i ); + if ( n.getNodeType() == Node.ELEMENT_NODE ) { + e = (Element)n; + break; + } + } + if ( e == null ) { + Element p = createNodeRecursive( "/VirtualBox/Machine/ExtraData" ); + e = addNewNode( p, "ExtraDataItem" ); + e.setAttribute( "name", key ); + } + e.setAttribute( "value", value ); + } /** * Creates a new element to the given parent node. |