<div dir="ltr"><div><div><div>Sorry my bad. I misread the patch giving it a quick glance after Nitesh mentioned it and had the feeling that there is something off with it.<br><br></div>I hope this is a better patch than the earlier one I posted.<br><br></div>Thanks,<br></div>Nishith<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 8:31 PM, Cole Robinson <span dir="ltr"><<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 05/04/2016 10:52 AM, Nitesh Konkar wrote:<br>
> Hello Nishith,<br>
><br>
> Just a small suggestion on the indentation part of the patch. I think your<br>
> indentation is off by 1 space.<br>
><br>
<br>
</span>Where did you spot an indentation issue? I glanced quickly but didnt see one.<br>
<br>
Though inn your quoted email it does indeed look wrong, but that's because<br>
your response is in html format with a non-monospace font.<br>
<br>
- Cole<br>
<span class=""><br>
><br>
> On Wed, May 4, 2016 at 8:22 PM, Nitesh Konkar <<a href="mailto:niteshkonkar.libvirt@gmail.com">niteshkonkar.libvirt@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:niteshkonkar.libvirt@gmail.com">niteshkonkar.libvirt@gmail.com</a>>> wrote:<br>
><br>
>     Hello Nishith,<br>
><br>
>     Just a small suggestion on the indentation part of the patch. I think your<br>
>     indentation is off by 1 space.<br>
><br>
>     Thanks,<br>
>     Nitesh Konkar.<br>
><br>
><br>
>     On Wed, May 4, 2016 at 7:55 PM, Nishith Shah <<a href="mailto:nishithshah.2211@gmail.com">nishithshah.2211@gmail.com</a><br>
</span><span class="">>     <mailto:<a href="mailto:nishithshah.2211@gmail.com">nishithshah.2211@gmail.com</a>>> wrote:<br>
><br>
>         Use vshCommandOptScaledInt instead of vshCommandOptULongLong so that<br>
>         values with suffixes can be passed when bytes are being passed along.<br>
>         Values for the iops parameters still need to be given in the absolute<br>
>         form as they are not bytes but numbers. Please refer to the bug link<br>
>         <a href="https://bugzilla.redhat.com/show_bug.cgi?id=885380" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=885380</a> which can be closed.<br>
><br>
>         Signed-off-by: Nishith Shah <<a href="mailto:nishithshah.2211@gmail.com">nishithshah.2211@gmail.com</a><br>
</span>>         <mailto:<a href="mailto:nishithshah.2211@gmail.com">nishithshah.2211@gmail.com</a>>><br>
<div><div class="h5">>         ---<br>
>          tools/virsh-domain.c | 24 ++++++++++++------------<br>
>          tools/virsh.pod      | 18 ++++++++++++------<br>
>          2 files changed, 24 insertions(+), 18 deletions(-)<br>
><br>
>         diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c<br>
>         index 0a6caae..336a65f 100644<br>
>         --- a/tools/virsh-domain.c<br>
>         +++ b/tools/virsh-domain.c<br>
>         @@ -1164,7 +1164,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "total-bytes-sec",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help = N_("total throughput limit in bytes per second")<br>
>         +     .help = N_("total throughput limit, as scaled integer (default<br>
>         bytes)")<br>
>              },<br>
>              {.name = "read_bytes_sec",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1172,7 +1172,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "read-bytes-sec",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help = N_("read throughput limit in bytes per second")<br>
>         +     .help = N_("read throughput limit, as scaled integer (default<br>
>         bytes)")<br>
>              },<br>
>              {.name = "write_bytes_sec",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1180,7 +1180,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "write-bytes-sec",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help =  N_("write throughput limit in bytes per second")<br>
>         +     .help =  N_("write throughput limit, as scaled integer (default<br>
>         bytes)")<br>
>              },<br>
>              {.name = "total_iops_sec",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1212,7 +1212,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "total-bytes-sec-max",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help = N_("total max in bytes")<br>
>         +     .help = N_("total max, as scaled integer (default bytes)")<br>
>              },<br>
>              {.name = "read_bytes_sec_max",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1220,7 +1220,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "read-bytes-sec-max",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help = N_("read max in bytes")<br>
>         +     .help = N_("read max, as scaled integer (default bytes)")<br>
>              },<br>
>              {.name = "write_bytes_sec_max",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1228,7 +1228,7 @@ static const vshCmdOptDef opts_blkdeviotune[] = {<br>
>              },<br>
>              {.name = "write-bytes-sec-max",<br>
>               .type = VSH_OT_INT,<br>
>         -     .help = N_("write max in bytes")<br>
>         +     .help = N_("write max, as scaled integer (default bytes)")<br>
>              },<br>
>              {.name = "total_iops_sec_max",<br>
>               .type = VSH_OT_ALIAS,<br>
>         @@ -1299,7 +1299,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>              if (vshCommandOptStringReq(ctl, cmd, "device", &disk) < 0)<br>
>                  goto cleanup;<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "total-bytes-sec",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "total-bytes-sec",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         @@ -1308,7 +1308,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>                      goto save_error;<br>
>              }<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "read-bytes-sec",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "read-bytes-sec",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         @@ -1317,7 +1317,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>                      goto save_error;<br>
>              }<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "write-bytes-sec",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "write-bytes-sec",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         @@ -1326,7 +1326,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>                      goto save_error;<br>
>              }<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "total-bytes-sec-max",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "total-bytes-sec-max",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         @@ -1335,7 +1335,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>                      goto save_error;<br>
>              }<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "read-bytes-sec-max",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "read-bytes-sec-max",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         @@ -1344,7 +1344,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)<br>
>                      goto save_error;<br>
>              }<br>
><br>
>         -    if ((rv = vshCommandOptULongLong(ctl, cmd, "write-bytes-sec-max",<br>
>         &value)) < 0) {<br>
>         +    if ((rv = vshCommandOptScaledInt(ctl, cmd, "write-bytes-sec-max",<br>
>         &value, 1, ULLONG_MAX)) < 0) {<br>
>                  goto interror;<br>
>              } else if (rv > 0) {<br>
>                  if (virTypedParamsAddULLong(&params, &nparams, &maxparams,<br>
>         diff --git a/tools/virsh.pod b/tools/virsh.pod<br>
>         index 2a95df7..6844823 100644<br>
>         --- a/tools/virsh.pod<br>
>         +++ b/tools/virsh.pod<br>
>         @@ -1097,15 +1097,21 @@ I<domain> (see also B<domblklist> for listing<br>
>         these names).<br>
><br>
>          If no limit is specified, it will query current I/O limits setting.<br>
>          Otherwise, alter the limits with these flags:<br>
>         -I<--total-bytes-sec> specifies total throughput limit in bytes per<br>
>         second.<br>
>         -I<--read-bytes-sec> specifies read throughput limit in bytes per second.<br>
>         -I<--write-bytes-sec> specifies write throughput limit in bytes per<br>
>         second.<br>
>         +I<--total-bytes-sec> specifies total throughput limit as a scaled<br>
>         integer, the<br>
>         +default being bytes per second if no suffix is specified.<br>
>         +I<--read-bytes-sec> specifies read throughput limit as a scaled<br>
>         integer, the<br>
>         +default being bytes per second if no suffix is specified.<br>
>         +I<--write-bytes-sec> specifies write throughput limit as a scaled<br>
>         integer, the<br>
>         +default being bytes per second if no suffix is specified.<br>
>          I<--total-iops-sec> specifies total I/O operations limit per second.<br>
>          I<--read-iops-sec> specifies read I/O operations limit per second.<br>
>          I<--write-iops-sec> specifies write I/O operations limit per second.<br>
>         -I<--total-bytes-sec-max> specifies maximum total throughput limit in<br>
>         bytes per second.<br>
>         -I<--read-bytes-sec-max> specifies maximum read throughput limit in<br>
>         bytes per second.<br>
>         -I<--write-bytes-sec-max> specifies maximum write throughput limit in<br>
>         bytes per second.<br>
>         +I<--total-bytes-sec-max> specifies maximum total throughput limit as<br>
>         a scaled<br>
>         +integer, the default being bytes per second if no suffix is specified<br>
>         +I<--read-bytes-sec-max> specifies maximum read throughput limit as a<br>
>         scaled<br>
>         +integer, the default being bytes per second if no suffix is specified.<br>
>         +I<--write-bytes-sec-max> specifies maximum write throughput limit as<br>
>         a scaled<br>
>         +integer, the default being bytes per second if no suffix is specified.<br>
>          I<--total-iops-sec-max> specifies maximum total I/O operations limit<br>
>         per second.<br>
>          I<--read-iops-sec-max> specifies maximum read I/O operations limit<br>
>         per second.<br>
>          I<--write-iops-sec-max> specifies maximum write I/O operations limit<br>
>         per second.<br>
>         --<br>
>         2.1.4<br>
><br>
>         --<br>
>         libvir-list mailing list<br>
</div></div>>         <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a> <mailto:<a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>><br>
>         <a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
><br>
> --<br>
> libvir-list mailing list<br>
> <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
><br>
<br>
</div></div></blockquote></div><br></div>