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

[libvirt] [PATCH] virsh: correct the cmdDomIfGetLink function return value error



From: Alex Jia <ajia redhat com>

* tools/virsh.c: Although finding interface with matching mac addr, forgot to
set 'ret' boolean value to 'true'.

* how to reproduce?
  % virsh domif-getlink <guest name> <interface mac>
  % echo $? 

Signed-off-by: Alex Jia <ajia redhat com>
---
 tools/virsh.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 276e1cc..91c3459 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1538,6 +1538,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
                 mac = virXMLPropString(cur, "address");
 
                 if (STRCASEEQ(mac, iface)){
+                    ret = true;
                     goto hit;
                 }
             }
-- 
1.7.1


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