[libvirt] [PATCH v4 7/7] blockjob: allow forcing of bytes scale in virsh

Peter Krempa pkrempa at redhat.com
Fri Sep 12 12:32:31 UTC 2014


On 09/12/14 05:55, Eric Blake wrote:
> Take the previous patch one step further.  In addition to
> automatically selecting byte mode with fallback if the
> user's result would be rounded, we also want to give the
> user a way to guarantee byte mode even if rounding is not
> required, with no fallback if the remote side doesn't
> support byte mode.  This way, virsh can be used to more
> fully test the impact of setting the bytes flag.
> 
> * tools/virsh-domain.c (blockJobBandwidth): Adjust return type and
> check for --bytes flag.
> (cmdBlockCommit, cmdBlockPull, cmdBlockJob): Add --bytes flag.
> (cmdBlockCopy): Likewise, and adjust caller.
> (blockJobImpl): Adjust caller.
> * tools/virsh.pod (blockcommit, blockcopy, blockpull, blockjob):
> Document this.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tools/virsh-domain.c | 57 ++++++++++++++++++++++++++++++++++------------------
>  tools/virsh.pod      | 48 +++++++++++++++++++++----------------------
>  2 files changed, 61 insertions(+), 44 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c

Whoah, this is getting a bit too complex IMHO for a simple task.

How about not doing any automagic switching and if the user specifies
the --bytes flag then it would be passed and otherwise just the old
MiB/s value. The --bytes flag could also parse the value as a scaled
integer then.

This would allow to drop a lot of the complexity while still allow to
use the new flags as we unfortunately have to stick with MiB/s in virsh.
That on the other hand doesn't force us to do overly complex logic that
can be left on the operator.

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140912/24cdf8b8/attachment-0001.sig>


More information about the libvir-list mailing list