Extract the IO_URING configuration into the agent.properties (#6253)

When using advanced virtualization the IO Driver is not supported. The
admin will decide if want to enable/disable this configuration from
agent.properties file. The default value is true
This commit is contained in:
slavkap 2022-04-13 14:43:35 +03:00 committed by GitHub
parent 91a5f0e285
commit 42a92dcdd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -285,3 +285,6 @@ iscsi.session.cleanup.enabled=false
# Enable manually setting CPU's topology on KVM's VM.
# enable.manually.setting.cpu.topology.on.kvm.vm=true
# Enable/disable IO driver for Qemu / It's enabled by default on KVM agents
# enable.io.uring=true

View File

@ -54,6 +54,13 @@ public class AgentProperties{
*/
public static final Property<Boolean> ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM = new Property<Boolean>("enable.manually.setting.cpu.topology.on.kvm.vm", true);
/**
* Enable manually IO driver on KVM's VM. <br>
* Data type: boolean.<br>
* Default value: true.
*/
public static final Property<Boolean> ENABLE_IO_URING = new Property<Boolean>("enable.io.uring", true);
public static class Property <T>{
private final String name;
private final T defaultValue;

View File

@ -2956,7 +2956,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
* (ii) Libvirt >= 6.3.0
*/
protected void setDiskIoDriver(DiskDef disk) {
if (getHypervisorLibvirtVersion() >= HYPERVISOR_LIBVIRT_VERSION_SUPPORTS_IO_URING && getHypervisorQemuVersion() >= HYPERVISOR_QEMU_VERSION_SUPPORTS_IO_URING) {
if (getHypervisorLibvirtVersion() >= HYPERVISOR_LIBVIRT_VERSION_SUPPORTS_IO_URING
&& getHypervisorQemuVersion() >= HYPERVISOR_QEMU_VERSION_SUPPORTS_IO_URING
&& AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ENABLE_IO_URING)) {
disk.setIoDriver(DiskDef.IoDriver.IOURING);
}
}