Bug 889276
Summary: | virsh reports no error message when using empty string as arguments for some command options | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Chris Evich <cevich> | |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | |
Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | low | |||
Version: | 6.5 | CC: | acathrow, ajia, codong, cwei, dyuan, eblake, mzhan, phrdina, shyu, ydu | |
Target Milestone: | rc | Keywords: | Upstream | |
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 894447 (view as bug list) | Environment: | ||
Last Closed: | 2014-04-04 20:59:18 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 894447 |
Description
Chris Evich
2012-12-20 16:50:33 UTC
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. Re-proposed for 6.5 It should be a common issue for virsh command, and I can confirm this question on libvirt-0.10.2-14.el6.x86_64, for example, [root@201 autotest]# virsh net-create "" [root@201 autotest]# echo $? 1 [root@201 autotest]# virsh domblkstat foo '' [root@201 autotest]# echo $? 1 And I can't also find a error message in libvirtd.log. The shell programming should parse single/double quotation firstly, so users probably need to use '\' to escape these special characters, for instance, [root@201 autotest]# virsh domblkstat foo \'\' error: Failed to get block stats foo '' error: invalid argument: invalid path: '' And I can see a expected error message in libvirtd.log: <slice> 2013-01-08 02:21:12.012+0000: 10249: debug : virDrvSupportsFeature:1505 : conn=0x7fb6340096b0, feature=9 2013-01-08 02:21:12.012+0000: 10242: debug : virDomainBlockStatsFlags:7280 : dom=0x7fb630056f30, (VM: name=foo-2, uuid=cae86633-904f-1c90-6bc4-9c579f70e699), disk='', params=(nil), nparams=0, flags=4 2013-01-08 02:21:12.018+0000: 10242: debug : virDomainFree:2281 : dom=0x7fb630056f30, (VM: name=foo-2, uuid=cae86633-904f-1c90-6bc4-9c579f70e699) 2013-01-08 02:21:12.019+0000: 10241: debug : virDrvSupportsFeature:1505 : conn=0x7fb6340096b0, feature=9 2013-01-08 02:21:12.019+0000: 10244: debug : virDomainBlockStatsFlags:7280 : dom=0x7fb63c132680, (VM: name=foo-2, uuid=cae86633-904f-1c90-6bc4-9c579f70e699), disk='', params=0x7fb63c299e80, nparams=8, flags=4 2013-01-08 02:21:12.019+0000: 10244: error : qemuDomainBlockStatsFlags:8626 : invalid argument: invalid path: '' 2013-01-08 02:21:12.019+0000: 10244: debug : virDomainFree:2281 : dom=0x7fb63c132680, (VM: name=foo-2, uuid=cae86633-904f-1c90-6bc4-9c579f70e699) 2013-01-08 02:21:12.021+0000: 10239: debug : virConnectClose:1449 : conn=0x7fb6340096b0 </slice> Maybe, we just need to document this for users. (In reply to comment #5) > The shell programming should parse single/double quotation firstly, so users > probably need to use '\' to escape these special characters, for instance, > > [root@201 autotest]# virsh domblkstat foo \'\' > error: Failed to get block stats foo '' > error: invalid argument: invalid path: '' That's a different argument. Libvirt is properly rejecting single quotes, what it is not rejecting is an empty string argument. It should be consistent and reject both, since it really should not be possible to create a disk with an empty string name. > > Maybe, we just need to document this for users. No, it is more than just a documentation bug, although it is still a corner case and not the most urgent of fixes. Found the domblkstat command has similar behavior, opened Bug # 894447 to cover that in case solution is different. This is a widespread issue. virsh isn't reporting errors on empty strings. I'm rephrasing the summary to fix all the issues to avoid additional bugs. *** Bug 894447 has been marked as a duplicate of this bug. *** (In reply to comment #8) > This is a widespread issue. virsh isn't reporting errors on empty strings. > I'm rephrasing the summary to fix all the issues to avoid additional bugs. Worse actually because it use to (in version shipped with RHEL5). This could lead someone to (superficially) believe an operation fails on RHEL 5 but works on RHEL 6 (unless they check the exit code). Add 'domid' to the list of virsh commands with this erronous behavior in RHEL 6. virsh dominfo is another one. I posted a big series that should kill all improper access of strings in virsh: http://www.redhat.com/archives/libvir-list/2013-January/msg01438.html The issues should be fixed upstream by commits: fbe2d49 virsh-secret: Refactor error paths 05af594 virsh-nwfilter: Update nwfilter commands to use vshCommandOptStringReq b2e8585 virsh-snapshot: Update snapshot commands to use vshCommandOptStringReq 351f7a2 virsh-snapshot: Refactor cmdSnapshotDumpXML e9dc073 virsh-nodedev: Refactor error paths, error messages and whitespace 7c5c51d virsh-nodedev: Update node device commands to use vshCommandOptStringReq 56dc64c virsh-interface: Update interface commands to use vshCommandOptStringReq 4e31e73 virsh-network: Update network commands to use vshCommandOptStringReq edbdc45 virsh-host: Update host commands to use vshCommandOptStringReq fa956d9 virsh-domain: Update domain commands to use vshCommandOptStringReq f605be8 virsh-domain-monitor: Update domain commands to use vshCommandOptStringReq 1daa4ba virsh-volume: Update volume commands to use vshCommandOptStringReq 98007c8 virsh-pool: Update pool commands to use vshCommandOptStringReq 41b5e84 virsh: Add helper to request string arguments with error reporting in version: v1.0.2-38-gfbe2d49 *** Bug 1002490 has been marked as a duplicate of this bug. *** Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. |