Add a helper which will use a collection of other helpers to determine whether a disk requires throttling to be enabled. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_command.c | 10 ++++++++++ src/qemu/qemu_command.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7fa366cd3f..bfd1b99351 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1031,6 +1031,16 @@ qemuDiskConfigBlkdeviotuneHasMaxLength(virDomainDiskDefPtr disk) } +bool +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk) +{ + return !!disk->blkdeviotune.group_name || + qemuDiskConfigBlkdeviotuneHasBasic(disk) || + qemuDiskConfigBlkdeviotuneHasMax(disk) || + qemuDiskConfigBlkdeviotuneHasMaxLength(disk); +} + + /** * qemuCheckDiskConfigBlkdeviotune: * @disk: disk configuration diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index cf17dc1ede..b8fbbbb92a 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -181,6 +181,9 @@ int qemuGetDriveSourceString(virStorageSourcePtr src, qemuDomainSecretInfoPtr secinfo, char **source); +bool +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk); + int qemuCheckDiskConfig(virDomainDiskDefPtr disk, virQEMUCapsPtr qemuCaps); -- 2.16.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list