Re: [PATCH 09/17] virsh-host: Update host commands to use vshCommandOptStringReq

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

 



On 2013年01月22日 02:07, Peter Krempa wrote:
---
  tools/virsh-host.c | 9 +++------
  1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index d05e435..5c33c2d 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -103,10 +103,9 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
      }

      VIR_FREE(ctl->name);
-    if (vshCommandOptString(cmd, "name",&name)<  0) {
-        vshError(ctl, "%s", _("Please specify valid connection URI"));
+    if (vshCommandOptStringReq(ctl, cmd, "name",&name)<  0)
          return false;
-    }
+
      ctl->name = vshStrdup(ctl, name);

      ctl->useGetInfo = false;
@@ -550,10 +549,8 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
      unsigned int suspendTarget;
      long long duration;

-    if (vshCommandOptString(cmd, "target",&target)<  0) {
-        vshError(ctl, _("Invalid target argument"));
+    if (vshCommandOptStringReq(ctl, cmd, "target",&target)<  0)
          return false;
-    }

      if (vshCommandOptLongLong(cmd, "duration",&duration)<  0) {
          vshError(ctl, _("Invalid duration argument"));

ACK

--
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]