Bug 1946936

Summary: Libvirt support for aio=io_uring in QEMU
Product: Red Hat Enterprise Linux 9 Reporter: Han Han <hhan>
Component: libvirtAssignee: Peter Krempa <pkrempa>
libvirt sub component: General QA Contact: Han Han <hhan>
Status: CLOSED COMPLETED Docs Contact:
Severity: unspecified    
Priority: medium CC: coli, dzheng, jdenemar, jmoyer, jsuchane, knoel, lmen, makhomed, meili, mtessun, pkrempa, pmores, qinwang, smitterl, thuth, virt-maint, xuzhang, ymankad
Version: 9.0Keywords: FutureFeature, TestOnly, Triaged
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1769598 Environment:
Last Closed: 2023-11-20 10:44:29 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version: 6.3.0
Embargoed:
Bug Depends On: 1947230    
Bug Blocks:    

Comment 1 Han Han 2021-04-07 09:58:54 UTC
Currently blocked by qemu:
# grep IO_URING /boot/config-5.11.0-2.el9.x86_64 
CONFIG_IO_URING=y

# virsh edit avocado-vt-vm1
error: unsupported configuration: io uring is not supported by this QEMU binary
Failed. Try again? [y,n,i,f,?]:

Comment 2 Peter Krempa 2021-04-07 10:39:52 UTC
*** Bug 1946935 has been marked as a duplicate of this bug. ***

Comment 3 Peter Krempa 2021-04-07 10:41:28 UTC
I think ON_QA is correct since the code from our side is already present in the current build.

Comment 4 Jeff Moyer 2021-06-02 17:55:28 UTC
FYI, we still do not plan to support io_uring in the RHEL 9.0 kernel.  The goal is to enable support in an update release.

Comment 19 Han Han 2023-05-24 07:10:38 UTC
Tested on libvirt-9.3.0-2.el9.x86_64 qemu-kvm-8.0.0-4.el9.x86_64 kernel-5.14.0-316.el9.x86_64 liburing-0.7-7.el9.x86_64:
Setup:
1. Set io_uring.enable=y in the host kernel cmdline

Steps:
1. Start a domain with the disk of io_uring
# ➜  ~ virsh dumpxml rhel-9.2 --xpath //disk
<disk type="file" device="disk">
  <driver name="qemu" type="qcow2" cache="none" io="io_uring" copy_on_read="on" ats="on" packed="o
n"/>   
  <source file="/var/lib/libvirt/images/rhel-9.2.qcow2" index="1"/>
  <backingStore/>
  <target dev="vda" bus="virtio"/>
  <alias name="virtio-disk0"/>
  <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</disk>

2. Hot-plug a disk of io_uring. Copy a disk of io_uring. Then check their qmp log
➜  ~ cat /tmp/vdb.xml
<disk type="file" device="disk">
  <driver name="qemu" type="raw" cache="none" io="io_uring" copy_on_read="on" ats="on" packed="on"/>
  <source file="/var/lib/libvirt/images/vdb" index="1"/>
  <backingStore/>
  <target dev="vdb" bus="virtio"/>
</disk>


➜  ~ virsh attach-device rhel-9.2 /tmp/vdb.xml
Device attached successfully


➜  ~ virsh blockcopy rhel-9.2 vdb /var/lib/libvirt/images/copy --transient-job 
Block Copy started

In qmp log, the "aio":"io_uring" is in the blockdev-add qmp.
 57.048 > 0x7f6e700942f0 {"execute":"blockdev-add","arguments":{"driver":"file","filename":"/var/l
ib/libvirt/images/vdb","aio":"io_uring","node-name":"libvirt-2-storage","cache":{"direct":true,"no
-flush":false},"auto-read-only":true,"discard":"unmap"},"id":"libvirt-423"}                       
 57.052 < 0x7f6e700942f0 {"return": {}, "id": "libvirt-423"}  
...
2397.669 > 0x7f6e700942f0 {"execute":"blockdev-add","arguments":{"driver":"file","filename":"/var/
lib/libvirt/images/copy","aio":"io_uring","node-name":"libvirt-3-storage","cache":{"direct":true,"
no-flush":false},"auto-read-only":true,"discard":"unmap"},"id":"libvirt-433"}                     
2397.672 < 0x7f6e700942f0 {"return": {}, "id": "libvirt-433"}

Comment 20 Thomas Huth 2023-11-20 10:44:29 UTC
Now that 9.3 has been released, I think this can be closed.