summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/openslx/libvirt/domain/Domain.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/Domain.java b/src/main/java/org/openslx/libvirt/domain/Domain.java
index 61d3bcc..9dc7200 100644
--- a/src/main/java/org/openslx/libvirt/domain/Domain.java
+++ b/src/main/java/org/openslx/libvirt/domain/Domain.java
@@ -373,6 +373,16 @@ public class Domain extends LibvirtXmlDocument
public void setFeatureKvmHiddenState( boolean on )
{
this.getRootXmlNode().setXmlElementAttributeValueOnOff( "features/kvm/hidden", "state", on );
+ this.getRootXmlNode().setXmlElement( "cpu" );
+ if ( on ) {
+ Element cpu = this.getRootXmlNode().getXmlElement( "cpu" );
+ XmlHelper.getOrCreateElement( this.getRootXmlNode().getXmlDocument(), cpu,
+ null, null,
+ "feature", "name", "hypervisor" );
+ this.getRootXmlNode().setXmlElementAttributeValue( "cpu/feature", "policy", "disable" );
+ } else {
+ this.getRootXmlNode().removeXmlElement( "cpu/feature[@name='hypervisor']" );
+ }
}
/**