From 8dcf3559739025fc97b17c1868ccff162cb92658 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 19 Sep 2016 06:41:05 -0400 Subject: [PATCH] conf: Add support for blkiotune "_length" options Modify _virDomainBlockIoTuneInfo and rng schema to support the _length options for bps/iops throttling values. Document the new values. --- docs/formatdomain.html.in | 40 +++++++++++- docs/schemas/domaincommon.rng | 38 +++++++++++ src/conf/domain_conf.c | 22 ++++++- .../qemuxml2argv-blkdeviotune-max-length.xml | 65 +++++++++++++++++++ ...qemuxml2xmlout-blkdeviotune-max-length.xml | 1 + tests/qemuxml2xmltest.c | 1 + 6 files changed, 165 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/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0cd68a0fd0..c70377ba48 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2617,7 +2617,45 @@ maximum write I/O operations per second.
size_iops_sec
The optional size_iops_sec element is the - size of I/O operations per second.
+ size of I/O operations per second. +

+ Throughput limits since 1.2.11 and QEMU 1.7 +

+ +
total_bytes_sec_max_length
+
The optional total_bytes_sec_max_length + element is the maximum duration in seconds for the + total_bytes_sec_max burst period. Only valid + when the total_bytes_sec_max is set.
+
read_bytes_sec_max_length
+
The optional read_bytes_sec_max_length + element is the maximum duration in seconds for the + read_bytes_sec_max burst period. Only valid + when the read_bytes_sec_max is set.
+
write_bytes_sec_max
+
The optional write_bytes_sec_max_length + element is the maximum duration in seconds for the + write_bytes_sec_max burst period. Only valid + when the write_bytes_sec_max is set.
+
total_iops_sec_max_length
+
The optional total_iops_sec_max_length + element is the maximum duration in seconds for the + total_iops_sec_max burst period. Only valid + when the total_iops_sec_max is set.
+
read_iops_sec_max_length
+
The optional read_iops_sec_max_length + element is the maximum duration in seconds for the + read_iops_sec_max burst period. Only valid + when the read_iops_sec_max is set.
+
write_iops_sec_max
+
The optional write_iops_sec_max_length + element is the maximum duration in seconds for the + write_iops_sec_max burst period. Only valid + when the write_iops_sec_max is set. +

+ Throughput length since 2.4.0 and QEMU 2.6 +

+
driver
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e6741bb3cc..dba9187aa7 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4963,6 +4963,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f556e4ca26..03506cbec1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7202,6 +7202,13 @@ virDomainDiskDefIotuneParse(virDomainDiskDefPtr def, PARSE_IOTUNE(size_iops_sec); + 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); + if ((def->blkdeviotune.total_bytes_sec && def->blkdeviotune.read_bytes_sec) || (def->blkdeviotune.total_bytes_sec && @@ -20379,7 +20386,13 @@ virDomainDiskDefFormat(virBufferPtr buf, def->blkdeviotune.total_iops_sec_max || def->blkdeviotune.read_iops_sec_max || def->blkdeviotune.write_iops_sec_max || - def->blkdeviotune.size_iops_sec) { + def->blkdeviotune.size_iops_sec || + def->blkdeviotune.total_bytes_sec_max_length || + def->blkdeviotune.read_bytes_sec_max_length || + def->blkdeviotune.write_bytes_sec_max_length || + def->blkdeviotune.total_iops_sec_max_length || + def->blkdeviotune.read_iops_sec_max_length || + def->blkdeviotune.write_iops_sec_max_length) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -20402,6 +20415,13 @@ virDomainDiskDefFormat(virBufferPtr buf, def->blkdeviotune.size_iops_sec); } + FORMAT_IOTUNE(total_bytes_sec_max_length); + FORMAT_IOTUNE(read_bytes_sec_max_length); + FORMAT_IOTUNE(write_bytes_sec_max_length); + FORMAT_IOTUNE(total_iops_sec_max_length); + FORMAT_IOTUNE(read_iops_sec_max_length); + FORMAT_IOTUNE(write_iops_sec_max_length); + virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml new file mode 100644 index 0000000000..c740751dbe --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml @@ -0,0 +1,65 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + + 5000 + 6000 + 10000 + 11000 + 3 + 5 + +
+ + + + + + + 5000 + 5500 + 3500 + 4000 + 6000 + 6500 + 7000 + 7500 + 2000 + 3 + 5 + 7 + 9 + +
+ + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml new file mode 120000 index 0000000000..67f3e9a0ea --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 64da80a83a..496ed130f8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -609,6 +609,7 @@ mymain(void) DO_TEST("usb-redir-filter-version", NONE); DO_TEST("blkdeviotune", NONE); DO_TEST("blkdeviotune-max", NONE); + DO_TEST("blkdeviotune-max-length", NONE); DO_TEST("controller-usb-order", NONE); DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE, GIC_NONE, NONE); -- GitLab