Bug 1592737
Summary: | Cannot use a xml file with XML declaration as a input of cpu-compare | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
Status: | CLOSED ERRATA | QA Contact: | jiyan <jiyan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.6 | CC: | bugproxy, chwen, dyuan, dzheng, fjin, hannsj_uhl, jdenemar, jiyan, jomurphy, lmen, xuzhang, yalzhang, yanqzhan |
Target Milestone: | rc | Keywords: | Automation, Regression |
Target Release: | 7.7 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-4.5.0-12.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-08-06 13:13:52 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: | 1598750, 1619379, 1651787, 1659045, 1659048 |
Description
Luyao Huang
2018-06-19 08:03:57 UTC
The cpu-compare and cpu-baseline virsh commands were made user friendly so that the user can pass various XMLs generated by other libvirt commands to them. The cpu-compare command takes a single XML document, while cpu-baseline accepts several concatenated XMLs. Thus there were two separate pieces of code dealing with the same. When I was adding the hypervisor variants of these commands I had to add support for parsing one more type of XML document generated by libvirt. While doing that, I merged the code for all the commands to reduce duplication. And because libvirt never produces the <?xml ?> declaration, the code does not work correctly when it sees <?xml ?>. I will try to look at this and come up with a fix which would not be too hacky. However, I don't see this as a big priority. Only virsh is affected, calling libvirt API (even using some of the bindings) directly would just work. And all avocado tests should really be rewritten to use libvirt's python bindings. Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2018-November/msg00838.html Fixed upstream by commit fcd1c865e168bdb9763b19e790c15e80aa29be66 Refs: v4.10.0-rc1-5-gfcd1c865e1 Author: Jiri Denemark <jdenemar> AuthorDate: Thu Nov 22 16:28:56 2018 +0100 Commit: Jiri Denemark <jdenemar> CommitDate: Thu Nov 29 11:46:42 2018 +0100 virsh: Strip XML declaration when extracting CPU XMLs Since commit v4.3.0-336-gc84726fbdd all {hypervisor-,}cpu-{baseline,compare} commands use a generic vshExtractCPUDefXMLs helper for extracting individual CPU definitions from the provided input file. The helper wraps the input file in a <container> element so that several independent elements can be easily parsed from the file. This works fine except when the file starts with XML declaration (<?xml version="1.0" ... ?>) because the XML declaration cannot be put inside any element. In fact it has to be at the very beginning of the XML document without any preceding white space characters. We can just simply skip the XML declaration. https://bugzilla.redhat.com/show_bug.cgi?id=1592737 Signed-off-by: Jiri Denemark <jdenemar> Reviewed-by: Ján Tomko <jtomko> *** Bug 1659045 has been marked as a duplicate of this bug. *** ------- Comment From satheera.com 2018-12-13 08:08 EDT------- Fixed by upstream commit Verified on libvirt-4.5.0-12.el7.x86_64. Version: kernel-3.10.0-1036.el7.x86_64 libvirt-4.5.0-12.el7.x86_64 qemu-kvm-rhev-2.12.0-25.el7.x86_64 Steps: 1. Prepare 2 intel/AMD hosts, and get the output of 'virsh capabilities' on each host # virsh capabilities >> cap_1.xml # virsh capabilities >> cap_2.xml # cat cap_1.xml >> cap.xml # cat cap_2.xml >> cap.xml 2. Test {hypervisor-,}cpu-{baseline,compare} commands with the 'cpu.xml' above # virsh hypervisor-cpu-baseline cap.xml <cpu mode='custom' match='exact'> <model fallback='forbid'>Penryn</model> <vendor>Intel</vendor> <feature policy='require' name='vme'/> <feature policy='require' name='ds'/> <feature policy='require' name='acpi'/> <feature policy='require' name='ss'/> <feature policy='require' name='ht'/> <feature policy='require' name='tm'/> <feature policy='require' name='pbe'/> <feature policy='require' name='dtes64'/> <feature policy='require' name='monitor'/> <feature policy='require' name='ds_cpl'/> <feature policy='require' name='vmx'/> <feature policy='require' name='tm2'/> <feature policy='require' name='xtpr'/> <feature policy='require' name='pdcm'/> <feature policy='require' name='xsave'/> <feature policy='require' name='osxsave'/> </cpu> # virsh hypervisor-cpu-compare cap.xml CPU described in cap.xml is incompatible with the CPU provided by hypervisor on the host # virsh cpu-baseline cap.xml <cpu mode='custom' match='exact'> <model fallback='allow'>Penryn</model> <vendor>Intel</vendor> <feature policy='require' name='vme'/> <feature policy='require' name='ds'/> <feature policy='require' name='acpi'/> <feature policy='require' name='ss'/> <feature policy='require' name='ht'/> <feature policy='require' name='tm'/> <feature policy='require' name='pbe'/> <feature policy='require' name='dtes64'/> <feature policy='require' name='monitor'/> <feature policy='require' name='ds_cpl'/> <feature policy='require' name='vmx'/> <feature policy='require' name='tm2'/> <feature policy='require' name='xtpr'/> <feature policy='require' name='pdcm'/> <feature policy='require' name='xsave'/> <feature policy='require' name='osxsave'/> </cpu> # virsh cpu-compare cap.xml CPU described in cap.xml is incompatible with host CPU All the test results are as expected, move this bug to be verified. In step-1, Add the <?xml version='1.0' encoding='UTF-8'?> XMl declaration at the first of each file. 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://access.redhat.com/errata/RHSA-2019:2294 |