Bug 1254152
Summary: | error should be improved when use some virsh command get failure | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7.2 | CC: | dyuan, eskultet, mzhan, rbalakri, yalzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.3.1-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:22:56 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Luyao Huang
2015-08-17 09:49:26 UTC
Send a patch to list: https://www.redhat.com/archives/libvir-list/2015-August/msg00639.html fixed upstream: commit 70f56dd72cdca309005c8234a8945721badbcfff Author: Luyao Huang <lhuang> Date: Mon Aug 17 17:56:48 2015 +0800 virsh: Reset global error after successfull domain lookup When looking up a domain, we try to look up by ID, UUID and NAME consequently while not really caring which of those lookups succeeds. The problem is that if any of them fails, we dispatch the error from the driver and that means setting both threadlocal and global error. Let's say the last lookup (by NAME) succeeds and resets the threadlocal error as any other API does, however leaving the global error unchanged. If the underlying virsh command does not succeed afterwards, our cleanup routine in vshCommandRun ensures that no libvirt error will be forgotten and that's exactly where this global error comes in incorrectly. # virsh domif-setlink 123 vnet1 up error: interface (target: vnet1) not found error: Domain not found: no domain with matching id 123 This patch also resets the global error which would otherwise cause some minor confusion in reported error messages. v1.2.18-135-g70f56dd Verified as below, the error message is excepted.Modify the bug to verified. # virsh list --all Id Name State ---------------------------------------------------- 16 123 running # virsh domiflist 123 Interface Type Source Model MAC ------------------------------------------------------- vnet0 network default rtl8139 52:54:00:bb:25:71 # virsh domiflist 1234 error: failed to get domain '1234' error: Domain not found: no domain with matching name '1234' # virsh domif-setlink 123 vnet1 up error: interface (target: vnet1) not found # virsh domif-setlink 16 vnet1 up error: interface (target: vnet1) not found # virsh domifstat 123 vnet1 error: Failed to get interface stats 123 vnet1 error: invalid argument: invalid path, 'vnet1' is not a known interface # virsh domiftune 123 vnet5 error: Unable to get interface parameters error: invalid argument: Can't find device vnet5 Comment 4 is verified on libvirt-1.3.1-1.el7.x86_64. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html |