From 42a92dcdd36fc3689b8d440e145614daa03f6635 Mon Sep 17 00:00:00 2001 From: slavkap <51903378+slavkap@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:43:35 +0300 Subject: [PATCH] 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 --- agent/conf/agent.properties | 3 +++ .../java/com/cloud/agent/properties/AgentProperties.java | 7 +++++++ .../hypervisor/kvm/resource/LibvirtComputingResource.java | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties index dafe7086d98..519b875f912 100644 --- a/agent/conf/agent.properties +++ b/agent/conf/agent.properties @@ -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 diff --git a/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java b/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java index 657876c13ac..980c9b080aa 100644 --- a/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java +++ b/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java @@ -54,6 +54,13 @@ public class AgentProperties{ */ public static final Property ENABLE_MANUALLY_SETTING_CPU_TOPOLOGY_ON_KVM_VM = new Property("enable.manually.setting.cpu.topology.on.kvm.vm", true); + /** + * Enable manually IO driver on KVM's VM.
+ * Data type: boolean.
+ * Default value: true. + */ + public static final Property ENABLE_IO_URING = new Property("enable.io.uring", true); + public static class Property { private final String name; private final T defaultValue; diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 425084e4c9b..b78749bb43b 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -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); } }