You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/05/20 08:26:28 UTC
[GitHub] [cloudstack] rohityadavcloud commented on a diff in pull request #6399: [KVM] Enable IOURING only when it is available on the host
rohityadavcloud commented on code in PR #6399:
URL: https://github.com/apache/cloudstack/pull/6399#discussion_r877878361
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -2949,6 +2949,33 @@ private KVMPhysicalDisk getPhysicalDiskPrimaryStore(PrimaryDataStoreTO primaryDa
return storagePool.getPhysicalDisk(data.getPath());
}
+ /**
+ * Check if IO_URING is supported by qemu
+ */
+ protected boolean isIoUringSupportedByQemu() {
+ s_logger.debug("Checking if iouring is supported");
+ String command = getIoUringCheckCommand();
+ if (org.apache.commons.lang3.StringUtils.isBlank(command)) {
+ s_logger.debug("Could not check iouring support, disabling it");
+ return false;
+ }
+ int exitValue = executeBashScriptAndRetrieveExitValue(command);
+ return exitValue == 0;
+ }
+
+ protected String getIoUringCheckCommand() {
+ String[] qemuPaths = {"/usr/bin/qemu-system-x86_64", "/usr/libexec/qemu-kvm", "/usr/bin/qemu-kvm" };
+ for (String qemuPath : qemuPaths) {
+ File file = new File(qemuPath);
+ if (file.exists()) {
+ String cmd = String.format("ldd %s | grep -Eqe '[[:space:]]liburing\\.so'", qemuPath);
Review Comment:
is this reliable @nvazquez cc others?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org