<div dir="ltr">Thanks, I did realize that after I sent the e-mail. Is there anything I can do to fix this or just be careful from the next time?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 8:22 PM, Nitesh Konkar <span dir="ltr"><<a href="mailto:niteshkonkar.libvirt@gmail.com" target="_blank">niteshkonkar.libvirt@gmail.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="im HOEnZb"><div dir="ltr"><div><div><div>Hello Nishith,<br><br></div>Just a small suggestion on the indentation part of the patch. I think your indentation is off by 1 space.<br><br></div>Thanks,<br></div>Nitesh Konkar.</div></span><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 8:22 PM, Nitesh Konkar <span dir="ltr"><<a href="mailto:niteshkonkar.libvirt@gmail.com" target="_blank">niteshkonkar.libvirt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello Nishith,<br><br></div>Just a small suggestion on the indentation part of the patch. I think your indentation is off by 1 space.<br><br></div>Thanks,<br></div>Nitesh Konkar.<br><br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 7:55 PM, Nishith Shah <span dir="ltr"><<a href="mailto:nishithshah.2211@gmail.com" target="_blank">nishithshah.2211@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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" target="_blank">nishithshah.2211@gmail.com</a>><br>
---<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 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 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 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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "total-bytes-sec", &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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "read-bytes-sec", &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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "write-bytes-sec", &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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "total-bytes-sec-max", &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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "read-bytes-sec-max", &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", &value)) < 0) {<br>
+    if ((rv = vshCommandOptScaledInt(ctl, cmd, "write-bytes-sec-max", &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 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 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 second.<br>
+I<--total-bytes-sec> specifies total throughput limit as a scaled 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 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 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 bytes per second.<br>
-I<--read-bytes-sec-max> specifies maximum read throughput limit in bytes per second.<br>
-I<--write-bytes-sec-max> specifies maximum write throughput limit in bytes per second.<br>
+I<--total-bytes-sec-max> specifies maximum total throughput limit as 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 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 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 per second.<br>
 I<--read-iops-sec-max> specifies maximum read I/O operations limit per second.<br>
 I<--write-iops-sec-max> specifies maximum write I/O operations limit per second.<br>
<span><font color="#888888">--<br>
2.1.4<br>
<br>
--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com" target="_blank">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>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>