From 13022ce430da9d6ce4dc9e9117d6be519e7afc4a Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Sun, 2 Oct 2016 08:24:31 -0400 Subject: [PATCH] virsh: Add _length parameters to virsh output https://bugzilla.redhat.com/show_bug.cgi?id=1349898 Add the duration parameters to the virsh input/output for blkdeviotune command and describe them in the pod file. Signed-off-by: John Ferlan --- tools/virsh-domain.c | 55 ++++++++++++++++++++++++++++++++++++++++++++ tools/virsh.pod | 21 +++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 4135735107..fe8c45856b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1263,6 +1263,54 @@ static const vshCmdOptDef opts_blkdeviotune[] = { .type = VSH_OT_INT, .help = N_("I/O size in bytes") }, + {.name = "total_bytes_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "total-bytes-sec-max-length" + }, + {.name = "total-bytes-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow total max bytes") + }, + {.name = "read_bytes_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "read-bytes-sec-max-length" + }, + {.name = "read-bytes-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow read max bytes") + }, + {.name = "write_bytes_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "write-bytes-sec-max-length" + }, + {.name = "write-bytes-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow write max bytes") + }, + {.name = "total_iops_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "total-iops-sec-max-length" + }, + {.name = "total-iops-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow total I/O operations max") + }, + {.name = "read_iops_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "read-iops-sec-max-length" + }, + {.name = "read-iops-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow read I/O operations max") + }, + {.name = "write_iops_sec_max_length", + .type = VSH_OT_ALIAS, + .help = "write-iops-sec-max-length" + }, + {.name = "write-iops-sec-max-length", + .type = VSH_OT_INT, + .help = N_("duration in seconds to allow write I/O operations max") + }, VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_LIVE, VIRSH_COMMON_OPT_DOMAIN_CURRENT, @@ -1336,6 +1384,13 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd) VSH_ADD_IOTUNE(read-iops-sec-max, READ_IOPS_SEC_MAX); VSH_ADD_IOTUNE(write-iops-sec-max, WRITE_IOPS_SEC_MAX); VSH_ADD_IOTUNE(size-iops-sec, SIZE_IOPS_SEC); + + VSH_ADD_IOTUNE(total-bytes-sec-max-length, TOTAL_BYTES_SEC_MAX_LENGTH); + VSH_ADD_IOTUNE(read-bytes-sec-max-length, READ_BYTES_SEC_MAX_LENGTH); + VSH_ADD_IOTUNE(write-bytes-sec-max-length, WRITE_BYTES_SEC_MAX_LENGTH); + VSH_ADD_IOTUNE(total-iops-sec-max-length, TOTAL_IOPS_SEC_MAX_LENGTH); + VSH_ADD_IOTUNE(read-iops-sec-max-length, READ_IOPS_SEC_MAX_LENGTH); + VSH_ADD_IOTUNE(write-iops-sec-max-length, WRITE_IOPS_SEC_MAX_LENGTH); #undef VSH_ADD_IOTUNE if (nparams == 0) { diff --git a/tools/virsh.pod b/tools/virsh.pod index 62c592cf62..8236a36fc2 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1135,6 +1135,10 @@ command. [[I] | [I] [I]] [[I] | [I] [I]] [[I] | [I] [I]] +[[I] | +[I] [I]] +[[I] | +[I] [I]] [I] Set or query the block disk io parameters for a block device of I. @@ -1162,6 +1166,18 @@ integer, the default being bytes per second if no suffix is specified. I<--total-iops-sec-max> specifies maximum total I/O operations limit per second. I<--read-iops-sec-max> specifies maximum read I/O operations limit per second. I<--write-iops-sec-max> specifies maximum write I/O operations limit per second. +I<--total-bytes-sec-max-length> specifies duration in seconds to allow maximum +total throughput limit. +I<--read-bytes-sec-max-length> specifies duration in seconds to allow maximum +read throughput limit. +I<--write-bytes-sec-max-length> specifies duration in seconds to allow maximum +write throughput limit. +I<--total-iops-sec-max-length> specifies duration in seconds to allow maximum +total I/O operations limit. +I<--read-iops-sec-max-length> specifies duration in seconds to allow maximum +read I/O operations limit. +I<--write-iops-sec-max-length> specifies duration in seconds to allow maximum +write I/O operations limit. I<--size-iops-sec> specifies size I/O operations limit per second. Older versions of virsh only accepted these options with underscore @@ -1172,6 +1188,11 @@ as --read-bytes-sec) resets the other two in that category to unlimited. An explicit 0 also clears any limit. A non-zero value for a given total cannot be mixed with non-zero values for read or write. +It is up to the hypervisor to determine how to handle the length values. +For the qemu hypervisor, if an I/O limit value or maximum value is set, +then the default value of 1 second will be displayed. Supplying a 0 will +reset the value back to the default. + If I<--live> is specified, affect a running guest. If I<--config> is specified, affect the next boot of a persistent guest. If I<--current> is specified, affect the current guest state.