RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 731151 - RFE: allow capabilities/guest XML to be used with virsh cpu-compare
Summary: RFE: allow capabilities/guest XML to be used with virsh cpu-compare
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 723540
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-16 19:20 UTC by Dave Allan
Modified: 2016-04-26 13:30 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Enhancement
Doc Text:
Clone Of: 723540
Environment:
Last Closed: 2012-06-20 06:30:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Dave Allan 2011-08-16 19:20:06 UTC
+++ This bug was initially created as a clone of Bug #723540 +++

Created attachment 514014 [details]
The <host> part of rhe "virsh capabilities" output

Description of problem:

cpu-compare fails to compare host CPU with any xml configuration file. Attached are the <host> part of the "virsh capabilities" output and a dumpxml of a running vm.

Version-Release number of selected component (if applicable):

Compiled from a git snapshot of the 0.9.3, sha1sum is 
11f94b9213440ac5b06161f8e4d07955e481ee81  libvirt-git-snapshot.tar.gz

How reproducible:

I didn't get it working

Steps to Reproduce:
1.virsh capabilities > capabilities.xml
2.virsh dumpxml VirtualTest > VirtualTest.xml
3.virsh cpu-compare capabilities.xml
Or
3.virsh cpu-compare VirtualTest.xml
  
Actual results:

Error :Failed to compare host CPU with input.xml
Error :internal error XML does not contain expected 'cpu' element

Expected results:
A comparison...


Additional info:
In the xml file, the cpu flag contains a "match" field. This could have lead to the error. However, in the capabilities, the cpu flag is a pure <cpu> </cpu> flag.
The error has been introduced with this patch : 
http://permalink.gmane.org/gmane.comp.emulators.libvirt/23032

The result has been obtained on ubuntu 11.04 64bits on a Xeon E5520
Running qemu 0.14.0

Kind regards

--- Additional comment from eton_vser on 2011-07-25 04:19:28 EDT ---

I finally understood it...

It's just that cpu-compare needs the <cpu> flag to be the root flag of the document... 

Couldn't we change it so we may compare the output of a dumpxml to a host cpu ?

Kind regards

Etienne

--- Additional comment from jdenemar on 2011-08-03 10:59:13 EDT ---

This seems like a useful addition, esp. considering that virsh cpu-baseline supports this.

Comment 2 Peter Krempa 2011-09-28 07:24:46 UTC
fixed with upstream commit:
commit 882e768ef0b2b11feeeab7fda0c5b5a3224ed57b
Author:     Peter Krempa <pkrempa>
AuthorDate: Thu Sep 15 09:18:04 2011 +0200

    virsh: Allow using domain and capabilities XMLs with cpu-compare
    
    This patch adds extraction of the <cpu> element from capabilities and
    domain definition XML documents to improve user experience.

Comment 5 Min Zhan 2012-01-10 07:19:47 UTC
Reproduce this bug with libvirt-0.9.4-23.el6.x86_64.

Verified this bug with libvirt-0.9.9-1.el6.

Steps:
1. Compare with capabilities file

# virsh capabilities > capabilities2.xml

# virsh cpu-compare capabilities2.xml 
Host CPU is a superset of CPU described in capabilities2.xml

2. Compare with guest xml which has cpu elements

# virsh dumpxml guest > rhel62.xml

# cat rhel62.xml
...
 <cpu match='exact'>
    <model>core2duo</model>
    <vendor>Intel</vendor>
    <topology sockets='1' cores='2' threads='1'/>
    <feature policy='disable' name='lahf_lm'/>
  </cpu>
...

# virsh cpu-compare rhel62.xml
Host CPU is a superset of CPU described in rhel62.xml

3. Compare with guest xml which has no cpu elements

# virsh cpu-compare rhel62.xml
error: File 'rhel62.xml' does not contain a <cpu> element or is not a valid domain or capabilities XML

Comment 7 errata-xmlrpc 2012-06-20 06:30:00 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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


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