Re: [PATCH] virsh: fix output the incorrect error after try failed

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

 




On 08/18/2015 08:56 PM, Erik Skultety wrote:

On 17/08/15 11:56, Luyao Huang wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1254152

When we use some virsh cmd which need specify domain
name/id/uuid, if the command get failure we will get error
like this:

  # virsh domif-setlink 123 vnet1 up
  error: interface (target: vnet1) not found
  error: Domain not found: no domain with matching id 123

The second line should be reset after call virshLookupDomainInternal,
because after some tries we get domain pointer, so output error
during we tried will make user confuse.

Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
  tools/virsh-domain.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 173bb15..69c5562 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -98,6 +98,8 @@ virshLookupDomainInternal(vshControl *ctl,
          dom = virDomainLookupByName(priv->conn, name);
      }
+ vshResetLibvirtError();
+
      if (!dom)
          vshError(ctl, _("failed to get domain '%s'"), name);
ACK, I reworded the commit message and pushed.

Thanks a lot for your quick review and help.

Erik

Luyao

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