diff options
author | Simon Rettberg | 2023-07-26 16:06:12 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-07-26 16:06:12 +0200 |
commit | 5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db (patch) | |
tree | d1c00386f5fd96d2833ea7c0dae7c4953979471d | |
parent | [spice] Switch default port to 59000 to lower risk of collision (diff) | |
download | master-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.tar.gz master-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.tar.xz master-sync-shared-5c7bfbf70b9d5ddc253e4cef30562adf9e37f7db.zip |
[libvirt] Extend setFeatureKvmHiddenState to fully fool Windows
-rw-r--r-- | src/main/java/org/openslx/libvirt/domain/Domain.java | 10 |
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']" ); + } } /** |