Symptom: after updating Pop OS 22.04 to Kernel 6.0.2 (via the regular rolling updates), qemu-based virtual disks with libvirt’s “cache mode” set to either none
or directsync
cannot be properly read, written, or booted from by virtual machines. Changing the cache mode to something else will make them work.
Request to the community: can anyone else who uses KVM virtualization on a Linux >= 6.0 host try any of the following:
- change cache mode on a (virtual) boot drive to either
none
ordirectsync
and see if it boots? - or alternatively, create a new virtual disk to an existing machine and try to create a filesystem on it, while having cache mode set to either
none
ordirectsync
?
These tasks both fail for me with kernel 6.0.2, but works as expected with 5.19.
Before filing a bug report somewhere I’d like to see whether it affects others, including other distros than Pop OS. If it does it would potentially have a large impact for production systems who migrate to kernel 6+.
Working config
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" discard="unmap"/>
<source file="/var/lib/libvirt/images/debian11-bugtest.qcow2"/>
<target dev="vda" bus="virtio"/>
<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</disk>
Result: guest system boots normally from the virtual drive.
Note: All selectable cache modes but none
and directsync
seems to work.
Not-working config
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none" discard="unmap"/>
<source file="/var/lib/libvirt/images/debian11-bugtest.qcow2"/>
<target dev="vda" bus="virtio"/>
<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</disk>
Result:
More details
I first brough this up in the “Small linux problem” thread, but after a closer look it seems significant enough to warrant a thread of its own (if not else for searchability in the future).
Software versions:
uname -a: 6.0.2-76060002-generic #202210150739~1666289067~22.04~fe0ce53 SMP PREEMPT_DYNAMIC Thu O x86_64 x86_64 x86_64 GNU/Linux
libvirt-daemon: 8.0.0-1ubuntu7.3
qemu-system-x86: 1:6.2+dfsg-2ubuntu6.5
Same problem regardless of disk model (sata/virtio/virtio-scsi) , guest firmware (UEFI vs BIOS), and guest OS (Debian vs. Windows 10). I did not try any other backing than qcow2 files (raw, zvol, device, …).