diff options
author | Simon Rettberg | 2023-07-27 16:10:42 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-07-27 16:10:42 +0200 |
commit | 559ec9a7ccdf3299048af95ce942b4c472944960 (patch) | |
tree | b1990bde54172a9ceb5b0b0675067396bbb4db14 | |
parent | [virt] Add check if VM is suspended (VMware only currently) (diff) | |
download | master-sync-shared-559ec9a7ccdf3299048af95ce942b4c472944960.tar.gz master-sync-shared-559ec9a7ccdf3299048af95ce942b4c472944960.tar.xz master-sync-shared-559ec9a7ccdf3299048af95ce942b4c472944960.zip |
[libvirt] If cpu mode is passtrough, pass through cpu cache info as well
-rw-r--r-- | src/main/java/org/openslx/libvirt/domain/Domain.java | 7 |
1 files changed, 7 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 a8b57ff..c19b2a3 100644 --- a/src/main/java/org/openslx/libvirt/domain/Domain.java +++ b/src/main/java/org/openslx/libvirt/domain/Domain.java @@ -728,6 +728,13 @@ public class Domain extends LibvirtXmlDocument public void setCpuMode( CpuMode mode ) { this.getRootXmlNode().setXmlElementAttributeValue( "cpu", "mode", mode.toString() ); + // Pass through cache information as well, because for some reason this is no the default + // when we do CPU host passthrough.... + if ( mode == CpuMode.HOST_PASSTHROUGH ) { + this.getRootXmlNode().setXmlElementAttributeValue( "cpu/cache", "mode", "passthrough" ); + } else if ( "passthrough".equals( this.getRootXmlNode().getXmlElementAttributeValue( "cpu/cache", "mode" ) ) ) { + this.getRootXmlNode().removeXmlElement( "cpu/cache" ); + } } /** |