On 7/17/23 21:43, Jonathon Jongsma wrote:
I believe that qemu 4.2.0 is the oldest version of qemu that we
still
support, so I don't think that a new capability would actually be
necessary for this.
Just for completeness, since Hyman is new contributor: this fact
Jonathon mentions is necessary but not sufficient. If a capability
depends on compile time/runtime configuration then we still want to have
capability. For instance, we have QEMU_CAPS_SPICE which tells whether
QEMU was built with SPICE support. Now, SPICE was introduced to QEMU
somewhere in 0.14 (according to [1]) which is way older than 4.2.0 (~8
years difference), and yet we still have a capability for it, because
QEMU can be built without SPICE support.
But this is not the case for '.discard' and '.write-zeroes' attributes
you are introducing as they are declared unconditionally in QEMU code:
hw/block/virtio-blk.c=1706=static Property virtio_blk_properties[] = {
--
hw/block/virtio-blk.c-1725- DEFINE_PROP_BIT64("discard", VirtIOBlock,
host_features,
hw/block/virtio-blk.c-1726- VIRTIO_BLK_F_DISCARD, true),
hw/block/virtio-blk.c-1727- DEFINE_PROP_BOOL("report-discard-granularity",
VirtIOBlock,
hw/block/virtio-blk.c-1728- conf.report_discard_granularity, true),
hw/block/virtio-blk.c:1729: DEFINE_PROP_BIT64("write-zeroes", VirtIOBlock,
host_features,
hw/block/virtio-blk.c-1730- VIRTIO_BLK_F_WRITE_ZEROES, true),
and both were introduced in QEMU commit v4.0.0-rc0~80^2~7. IOW, this
capability would be always set and thus is redundant.
BTW: to check the minimal version required by libvirt you can use plain
grep:
libvirt.git $ grep QEMU_MIN_ src/qemu/qemu_capabilities.c
#define QEMU_MIN_MAJOR 4
#define QEMU_MIN_MINOR 2
#define QEMU_MIN_MICRO 0
1:
https://wiki.qemu.org/ChangeLog/0.14
Michal