render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From a9dbb5abbf4b8f6980cb584d7ff70654b9d426bc Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <a9dbb5abbf4b8f6980cb584d7ff70654b9d426bc@dist-git>
9119d9
From: Shanzhi Yu <shyu@redhat.com>
9119d9
Date: Wed, 3 Dec 2014 13:35:28 -0500
9119d9
Subject: [PATCH] virsh: vol-upload disallow negative offset
9119d9
9119d9
Commit 570d0f63 describes disabling negative offset usage for
9119d9
vol-upload/download (e.g. cmdVolDownload and cmdVolUpload; however,
9119d9
the change was only made to cmdVolDownload. There was no change to
9119d9
cmdVolUpload.  This patch adds the same checks for vol-upload.
9119d9
9119d9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1087104
9119d9
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
9119d9
(cherry picked from commit cd53d947eff4aeebc8b534f874431f3fd2c0cf67)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 tools/virsh-volume.c | 6 +++---
9119d9
 1 file changed, 3 insertions(+), 3 deletions(-)
9119d9
9119d9
diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c
9119d9
index 4f810f8..cbc31d7 100644
9119d9
--- a/tools/virsh-volume.c
9119d9
+++ b/tools/virsh-volume.c
9119d9
@@ -677,13 +677,13 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd)
9119d9
     const char *name = NULL;
9119d9
     unsigned long long offset = 0, length = 0;
9119d9
 
9119d9
-    if (vshCommandOptULongLongWrap(cmd, "offset", &offset) < 0) {
9119d9
-        vshError(ctl, _("Unable to parse integer"));
9119d9
+    if (vshCommandOptULongLong(cmd, "offset", &offset) < 0) {
9119d9
+        vshError(ctl, _("Unable to parse offset value"));
9119d9
         return false;
9119d9
     }
9119d9
 
9119d9
     if (vshCommandOptULongLongWrap(cmd, "length", &length) < 0) {
9119d9
-        vshError(ctl, _("Unable to parse integer"));
9119d9
+        vshError(ctl, _("Unable to parse length value"));
9119d9
         return false;
9119d9
     }
9119d9
 
9119d9
-- 
9119d9
2.2.0
9119d9