From: Peter Krempa Date: Tue, 7 Oct 2025 12:57:50 +0000 (+0200) Subject: qemu: capabilities: Introduce QEMU_CAPS_DISK_TIMED_STATS X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c4234b34ed125b300bee9c9fddf286fb9c409e1;p=thirdparty%2Flibvirt.git qemu: capabilities: Introduce QEMU_CAPS_DISK_TIMED_STATS The capability tracks support for 'stats-intervals' property of disk frontends which enables statistics collection on the devices. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bc664c7429..c6d312447a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -746,6 +746,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 485 */ "acpi-generic-initiator", /* QEMU_CAPS_ACPI_GENERIC_INITIATOR */ + "disk-timed-stats", /* QEMU_CAPS_DISK_TIMED_STATS */ ); @@ -1478,6 +1479,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioBlk[] = { { "queue-size", QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE, NULL }, { "acpi-index", QEMU_CAPS_ACPI_INDEX, NULL }, { "iothread-vq-mapping", QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING, NULL }, + { "stats-intervals", QEMU_CAPS_DISK_TIMED_STATS, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioNet[] = { @@ -1509,9 +1511,11 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVfioPCI[] = { static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsSCSIDisk[] = { { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL, NULL }, { "rotation_rate", QEMU_CAPS_ROTATION_RATE, NULL }, + { "stats-intervals", QEMU_CAPS_DISK_TIMED_STATS, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsIDEDrive[] = { + { "stats-intervals", QEMU_CAPS_DISK_TIMED_STATS, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsPiix4PM[] = { @@ -1523,6 +1527,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBRedir[] = { }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBStorage[] = { + { "stats-intervals", QEMU_CAPS_DISK_TIMED_STATS, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsKVMPit[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 4496559e4d..3ca0b419fe 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -727,6 +727,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 485 */ QEMU_CAPS_ACPI_GENERIC_INITIATOR, /* -object acpi-generic-initiator */ + QEMU_CAPS_DISK_TIMED_STATS, /* timed stats support ('stats-intervals' property of disk frontends) */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml index cd2a2c8aa7..3d83a278c8 100644 --- a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml @@ -213,6 +213,7 @@ + 10001050 43100287 v10.1.0-1969-g53b41bb789