diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 724a86bc66..b528928741 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -787,13 +787,13 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) unsigned long long offset = 0, length = 0; bool created = false; - if (vshCommandOptULongLongWrap(cmd, "offset", &offset) < 0) { - vshError(ctl, _("Unable to parse integer")); + if (vshCommandOptULongLong(cmd, "offset", &offset) < 0) { + vshError(ctl, _("Unable to parse offset value")); return false; } if (vshCommandOptULongLongWrap(cmd, "length", &length) < 0) { - vshError(ctl, _("Unable to parse integer")); + vshError(ctl, _("Unable to parse length value")); return false; } diff --git a/tools/virsh.pod b/tools/virsh.pod index 1a2b01fb2c..e02ff5daed 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2961,7 +2961,10 @@ is in. I is the name or key or path of the volume where the file will be uploaded. I<--offset> is the position in the storage volume at which to start writing -the data. I<--length> is an upper bound of the amount of data to be uploaded. +the data. The value must be 0 or larger. I<--length> is an upper bound +of the amount of data to be uploaded. A negative value is interpreted +as an unsigned long long value to essentially include everything from +the offset to the end of the volume. An error will occur if the I is greater than the specified length. =item B [I<--pool> I] [I<--offset> I] @@ -2972,7 +2975,10 @@ I<--pool> I is the name or UUID of the storage pool the volume is in. I is the name or key or path of the volume to download. I<--offset> is the position in the storage volume at which to start reading -the data. I<--length> is an upper bound of the amount of data to be downloaded. +the data. The value must be 0 or larger. I<--length> is an upper bound of +the amount of data to be downloaded. A negative value is interpreted as +an unsigned long long value to essentially include everything from the +offset to the end of the volume. =item B [I<--pool> I] [I<--algorithm> I] I