On 08/26/2014 09:12 AM, Peter Krempa wrote:
On 08/26/14 13:21, Eric Blake wrote:
> Expose the new power of virDomainBlockCopy through virsh. Continue
> to use the older API where possible, for maximum compatibility.
>
> @@ -1901,18 +1935,82 @@ cmdBlockCopy(vshControl *ctl, const
vshCmd *cmd)
> vshError(ctl, "%s", _("bandwidth must be a number"));
> goto cleanup;
> }
> + if (vshCommandOptUIntWrap(cmd, "granularity", &granularity) <
0) {
> + vshError(ctl, "%s", _("granularity must be a number"));
> + goto cleanup;
> + }
I don't think wrapping makes sense here as you've documented that it has
to be a power of 2.
Oh, good point.
> + if (vshCommandOptUIntWrap(cmd, "buf-size", &buf_size) < 0) {
> + vshError(ctl, "%s", _("buf-size must be a number"));
> + goto cleanup;
> + }
Not a power of two here, but another case where wrapping is not worth
it. It's easier to add wrapping later than it is to remove it once
added, so blame my copy-and-paste, and I'll forbid negative numbers on
the next iteration.
ACK, the wrapped granularity number should be rejected by the
daemon.
Peter
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org