Bug 1281707
Summary: | some virsh cmd get failure without set error message | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 7.2 | CC: | dyuan, jtomko, 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:30:37 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-11-13 08:23:06 UTC
*** Bug 1261432 has been marked as a duplicate of this bug. *** Upstream patches: https://www.redhat.com/archives/libvir-list/2015-December/msg00100.html Pushed as: commit 45138725cf2a14575aa5204fe55efd6668b9b03a Author: Ján Tomko <jtomko> CommitDate: 2015-12-03 13:58:52 +0100 virsh: report errors for empty strings Several callers were using vshCommandOptString without setting an error. Use vshCommandOptStringReq which sets the error. https://bugzilla.redhat.com/show_bug.cgi?id=1281707 git describe: v1.3.0-rc1-4-g4513872 Verified on libvirt-1.3.1-1.el7.x86_64, the results as expected. All the command on the bug will get a fail information. 1. [root@work images]# virsh blockcopy test --dest /var/lib/libvirt/images/bak vda Block Copy started [root@work images]# virsh blockcopy test --dest ' ' vda Block Copy started [root@work images]# virsh blockcopy test --dest '' vda error: Failed to get option 'dest': Option argument is empty [root@work images]# virsh blockcopy test --dest /var/lib/libvirt/images/bbk --path '' error: Failed to get option 'path': Option argument is empty [root@work images]# virsh blockcopy test --dest /var/lib/libvirt/images/bbk error: command 'blockcopy' requires <path> option [root@work images]# virsh blockcopy test vda error: need either --dest or --xml 2. [root@work Desktop]# virsh event rhel7.2 --event '' error: Failed to get option 'event': Option argument is empty [root@work Desktop]# virsh event rhel7.2 --event 'ss' error: unknown event type ss [root@work Desktop]# virsh event rhel7.2 --event "lifecycle" event 'lifecycle' for domain rhel7.2: Resumed Unpaused events received: 1 [root@work Desktop]# virsh event rhel7.2 --event error: expected syntax: --event <string> 3. [root@work images]# virsh net-event default --event '' error: Failed to get option 'event': Option argument is empty [root@work images]# virsh net-event default --event ' ' error: unknown event type [root@work images]# virsh net-event default --event ss error: unknown event type ss 4. see bug 1261432 [root@work images]# virsh net-dhcp-leases default --mac '' error: Failed to get option 'mac': Option argument is empty [root@work images]# virsh net-dhcp-leases default --mac ' ' error: Failed to get leases info for default error: invalid MAC address: [root@work images]# virsh net-dhcp-leases default --mac 99 error: Failed to get leases info for default error: invalid MAC address: 99 5. [root@test /]# virsh domifaddr rhel7.2 '' error: Failed to get option 'interface': Option argument is empty [root@test /]# virsh domifaddr rhel7.2 Name MAC address Protocol Address ------------------------------------------------------------------------------- vnet0 52:54:00:1b:6f:e5 ipv4 192.168.122.159/24 [root@test /]# virsh domifaddr rhel7.2 vnet1 Name MAC address Protocol Address ------------------------------------------------------------------------------- [root@test /]# virsh destroy rhel7.2 Domain rhel7.2 destroyed [root@test /]# virsh domifaddr rhel7.2 error: Failed to query for interfaces addresses error: Requested operation is not valid: domain is not running Modify the bug status to verified. 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 |