[libvirt] [PATCH v2 3/8] blockcopy: expose new API in virsh

Eric Blake eblake at redhat.com
Tue Aug 26 20:47:45 UTC 2014


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

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


More information about the libvir-list mailing list