Bug 1143837 - libvirt should improve error message output when use domstats with option --domain and --list-*
Summary: libvirt should improve error message output when use domstats with option --d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-18 06:10 UTC by Luyao Huang
Modified: 2015-11-19 05:52 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.16-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:52:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Luyao Huang 2014-09-18 06:10:58 UTC
description of problem:
libvirt should improve error message output when use domstats with option --domain and --list-*

Version-Release number of selected component (if applicable):
libvirt-1.2.8-2.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.# virsh domstats  --list-active
Domain: 'r6'
  state.state=1
  state.reason=1

Domain: 'test3'
  state.state=1
  state.reason=1

2.# virsh domstats  --domain r6
Domain: 'r6'
  state.state=1
  state.reason=1


3.# virsh domstats  --list-active --domain r6
error: unsupported flags (0x1) in function qemuConnectGetAllDomainStats

4.

Actual results:
output message is not clear enough and libvirt should add a check for mutually exclusive between options

Expected results:
# virsh domstats  --list-active --domain r6
error: Options --domain and --list-active are mutually exclusive

Additional info:

Comment 1 Luyao Huang 2015-02-13 10:01:37 UTC
This is an old patch i have write:

https://www.redhat.com/archives/libvir-list/2014-November/msg00069.html

Comment 2 Pavel Hrdina 2015-03-31 13:38:55 UTC
Proposed upstream patch:

https://www.redhat.com/archives/libvir-list/2015-March/msg01587.html

To: Luyao

I didn't replied to your mail because it's quite old.  Your fix isn't good as the options are available only for virsh and there is no _DOMAIN flag equivalent to --domain option.  I've sent a patch with different approach to fix this bug.

Comment 3 Luyao Huang 2015-04-01 01:22:32 UTC
(In reply to Pavel Hrdina from comment #2)
> Proposed upstream patch:
> 
> https://www.redhat.com/archives/libvir-list/2015-March/msg01587.html
> 
> To: Luyao
> 
> I didn't replied to your mail because it's quite old.  Your fix isn't good
> as the options are available only for virsh and there is no _DOMAIN flag
> equivalent to --domain option.  I've sent a patch with different approach to
> fix this bug.

Hi Pavel,

No problem. It is a quite old mail and I think your patch are right. If I can go back to post, i would write a better one :-P

Comment 4 Pavel Hrdina 2015-05-04 10:45:36 UTC
Proposed another upstream patch:

https://www.redhat.com/archives/libvir-list/2015-May/msg00018.html

Comment 5 Pavel Hrdina 2015-05-13 15:40:33 UTC
This bug is now fixed by upstream commit:

commit 85d8ede9eb1da870e553f43dea215606ec47d190
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Wed Apr 29 16:41:20 2015 +0200

    qemu: Convert qemuConnectGetAllDomainStats to use new helpers
    
    Use the new domain list collection helpers to avoid going through
    virDomainPtrs.
    
    This additionally implements filter capability when called through the
    api that accepts domain list filters.

v1.2.15-51-g85d8ede


Now there will be no error message, because filtering list of domains is now supported.

Comment 7 Fangge Jin 2015-07-29 07:28:09 UTC
I can reproduce this bug on build libvirt-1.2.8-2.el7.x86_64.

Verify this bug on build libvirt-1.2.17-2.el7.x86_64.

Verify steps:

1.# virsh domstats --list-active
Domain: 'r71-2'
  state.state=1
  state.reason=1
  cpu.time=32803184141
  cpu.user=3950000000
......

Domain: 'rhel7-5'
  state.state=1
  state.reason=1
  cpu.time=314099234182
  cpu.user=2780000000
......

2.# virsh domstats --list-active --domain r71-2
Domain: 'r71-2'
  state.state=1
  state.reason=1
  cpu.time=42220250694
  cpu.user=5270000000
......

List successfully in step2. So move to verified.

Comment 9 errata-xmlrpc 2015-11-19 05:52:58 UTC
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/RHBA-2015-2202.html


Note You need to log in before you can comment on or make changes to this bug.