From: Yan Xiu Wu <wuyx(a)linux.ibm.com>
No need to use both "iotune" and "throttlefilters" for specific disk
Signed-off-by: Yan Xiu Wu <wuyx(a)linux.ibm.com>
---
src/conf/domain_validate.c | 8 ++++++++
src/qemu/qemu_driver.c | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index fffe274afc..be51e66ac8 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -956,6 +956,14 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
}
+ if (disk->throttlefilters && (disk->blkdeviotune.group_name ||
+ virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune))) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("block 'throttlefilters' can't be used together
with 'iotune' for disk '%1$s'"),
+ disk->dst);
+ return -1;
+ }
+
return 0;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index da0f9590db..d74a970aae 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14828,6 +14828,12 @@ qemuDomainDiskBlockIoTuneIsSupported(virDomainDiskDef *disk)
return false;
}
+ if (disk->throttlefilters) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("block 'iotune' can't be used together with
'throttlefilters' for disk '%1$s'"), disk->dst);
+ return false;
+ }
+
return true;
}
--
2.34.1