Bug 1986509
Summary: | libvirt does not pass discard flag to copy-on-read blockdev layers | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Richard W.M. Jones <rjones> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Han Han <hhan> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 9.0 | CC: | jdenemar, lmen, mxie, pkrempa, tzheng, virt-maint, xuzhang |
Target Milestone: | beta | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-7.6.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-12-07 21:57:54 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | 7.6.0 |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 910269 |
Description
Richard W.M. Jones
2021-07-27 17:42:23 UTC
Fixed upstream: commit dc0b9c8376afb88eb3a3156d7e991d29d9c196a8 Author: Peter Krempa <pkrempa> Date: Tue Jul 27 19:12:09 2021 +0200 qemu: block: Pass discard requests through the copy-on-read block filter We need to pass the 'trim' requests through the copy-on-read filter so if a user configures a discard policy on the disk the requests get through to the appropriate format layer in the blockdev tree. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1986509 Reported-by: Richard W.M. Jones <rjones> Tested-by: Richard W.M. Jones <rjones> Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Daniel P. Berrangé <berrange> Reviewed-by: Michal Privoznik <mprivozn> Reviewed-by: Richard W.M. Jones <rjones> v7.6.0-rc1-4-gdc0b9c8376 Reproduced on libvirt-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64: For an VM with XML: <domain> ... <disk> ... <driver name='qemu' type='qcow2' copy_on_read='on' discard='unmap'/> ... </disk> ... </domain> Extract its qemu cmdline by `virsh domxml-to-native --domain VM qemu-argv` The qemu cmdline of -blockdev is: -blockdev '{"driver":"gluster","volume":"gv0","path":"hhan.qcow2","server":[{"type":"inet","host":"10.0.148.14","port":"24007"}],"debug":4,"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' -blockdev '{"node-name":"libvirt-1-format","read-only":false,"discard":"unmap","driver":"qcow2","file":"libvirt-1-storage"}' -blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda","file":"libvirt-1-format"}' The "discard":"unmap" is not in the copy-on-read layer. The libvirt upstream has covered this unit test. Tested on libvirt-7.6.0-2.el9.x86_64 as comment3: Results: -blockdev {"node-name":"libvirt-1-format","read-only":false,"discard":"unmap","driver":"qcow2","file":"libvirt-1-storage","backing":null} -blockdev {"driver":"copy-on-read","node-name":"libvirt-CoR-sda","file":"libvirt-1-format","discard":"unmap"} "discard":"unmap" is in copy-on-read blockdev node. |