]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: vol-upload disallow negative offset
authorShanzhi Yu <shyu@redhat.com>
Wed, 3 Dec 2014 07:53:38 +0000 (15:53 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 3 Dec 2014 13:43:59 +0000 (08:43 -0500)
Commit 570d0f63 describes disabling negative offset usage for
vol-upload/download (e.g. cmdVolDownload and cmdVolUpload; however,
the change was only made to cmdVolDownload. There was no change to
cmdVolUpload.  This patch adds the same checks for vol-upload.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1087104
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
tools/virsh-volume.c

index 27bd81d30cfbc037284990604a1cda19f9a1779d..d585ee272d2953ae58572d5472f03f93534c2ca2 100644 (file)
@@ -677,13 +677,13 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd)
     const char *name = NULL;
     unsigned long long offset = 0, length = 0;
 
-    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;
     }