Re: [PATCH v2] virsh: Print error if specified bandwidth is invalid for blockjob

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/22/2011 05:16 AM, Osier Yang wrote:
It's strange that the command fails but without any error if one
specifies as not a number.
---
  tools/virsh.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index ffb4ced..5eeaee6 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5209,8 +5209,10 @@ blockJobImpl(vshControl *ctl, const vshCmd *cmd,
      if (vshCommandOptString(cmd, "path",&path)<  0)
          goto out;

-    if (vshCommandOptUL(cmd, "bandwidth",&bandwidth)<  0)
+    if (vshCommandOptUL(cmd, "bandwidth",&bandwidth)<  0) {
+        vshError(ctl, "%s", _("bandwidth must be a number"));
          goto out;
+    }

ACK.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]