summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSimon Rettberg2023-07-26 16:06:12 +0200
committerSimon Rettberg2023-07-26 16:06:12 +0200
commit5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db (patch)
treed1c00386f5fd96d2833ea7c0dae7c4953979471d /src/main/java
parent[spice] Switch default port to 59000 to lower risk of collision (diff)
downloadmaster-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.tar.gz
master-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.tar.xz
master-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.zip
[libvirt] Extend setFeatureKvmHiddenState to fully fool Windows
Diffstat (limited to 'src/main/java')
-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']" );
+ }
}
/**