On 23.09.2016 14:56, John Ferlan wrote:
Modify _virDomainBlockIoTuneInfo and rng schema to support the
_length
options for bps/iops throttling values. Document the new values.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/formatdomain.html.in | 40 ++++++++++++-
docs/schemas/domaincommon.rng | 38 +++++++++++++
src/conf/domain_conf.c | 45 ++++++++++++++-
.../qemuxml2argv-blkdeviotune-max-length.xml | 65 ++++++++++++++++++++++
.../qemuxml2xmlout-blkdeviotune-max-length.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
6 files changed, 188 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 861a15d..6e405c4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7134,6 +7134,21 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
_("disk iotune field '%s_max' must be an
integer"), \
#val); \
return -1; \
+ } \
+ if (virXPathULongLong("string(./iotune/" #val "_max_length)",
\
+ ctxt, &def->blkdeviotune.val##_max_length) == -2) { \
+ virReportError(VIR_ERR_XML_ERROR, \
+ _("disk iotune field '%s_max_length' must be "
\
+ "an integer"), #val);
\
+ return -1; \
+ }
+
+#define CHECK_IOTUNE_MAX_LENGTH(val) \
+ if (def->blkdeviotune.val##_length && !def->blkdeviotune.val) {
\
+ virReportError(VIR_ERR_XML_ERROR, \
+ _("disk iotune '%s'_length cannot be set unless
" \
+ "disk iotune '%s' is also set"), #val, #val);
\
+ return -1; \
}
static int
@@ -7155,6 +7170,13 @@ virDomainDiskDefIotuneParse(virDomainDiskDefPtr def,
return -1;
}
+ //PARSE_IOTUNE(total_bytes_sec_max_length);
+ //PARSE_IOTUNE(read_bytes_sec_max_length);
+ //PARSE_IOTUNE(write_bytes_sec_max_length);
+ //PARSE_IOTUNE(total_iops_sec_max_length);
+ //PARSE_IOTUNE(read_iops_sec_max_length);
+ //PARSE_IOTUNE(write_iops_sec_max_length);
+
Whoa, probably a leftover from development? Drop it.
if ((def->blkdeviotune.total_bytes_sec &&
def->blkdeviotune.read_bytes_sec) ||
(def->blkdeviotune.total_bytes_sec &&
Michal