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 1075874 - libvirt-cim should ensure to keep/define the <controller> elements
Summary: libvirt-cim should ensure to keep/define the <controller> elements
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-cim
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-13 05:28 UTC by Jincheng Miao
Modified: 2016-04-26 16:09 UTC (History)
6 users (show)

Fixed In Version: libvirt-cim-0.6.3-19.el7
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 10:18:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
This is guest xml (2.01 KB, text/xml)
2014-03-13 05:28 UTC, Jincheng Miao
no flags Details
This is xml for wbemexec (1.05 KB, text/xml)
2014-03-13 05:29 UTC, Jincheng Miao
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2307 0 normal SHIPPED_LIVE libvirt-cim bug fix update 2015-11-19 09:54:29 UTC

Description Jincheng Miao 2014-03-13 05:28:09 UTC
Created attachment 873794 [details]
This is guest xml

Description of problem:

Libvirt-cim should ensure to keep/define the <controller> elements.
Otherwise the domain xml generated by libvirt-cim lacks pci controller,
so that libvirtd will reject the change from cim client.

Version-Release number of selected component (if applicable):
# rpm -q libvirt-cim
libvirt-cim-0.6.3-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. define a guest like:

# virsh dumpxml test
<domain type='kvm'>
  <name>test</name>
  <uuid>1536d0ce-e8e8-11e2-9094-5fff350163f4</uuid>
  <memory dumpCore='on' unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.4.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='kvm' type='raw' cache='none'/>
      <source file='/tmp/test.img'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <shareable/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

2. Then change machine property from 'rhel6.4.0' to 'fedora' using test_machine.xml

# cat test_machine.xml 
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<METHODCALL NAME="ModifySystemSettings">
<LOCALINSTANCEPATH>
 <LOCALNAMESPACEPATH>
  <NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="virt"></NAMESPACE>
 </LOCALNAMESPACEPATH>
 <INSTANCENAME CLASSNAME="KVM_VirtualSystemManagementService">
  <KEYBINDING NAME="CreationClassName"><KEYVALUE VALUETYPE="string">KVM_VirtualSystemManagementService</KEYVALUE></KEYBINDING>
  <KEYBINDING NAME="Name"><KEYVALUE VALUETYPE="string">Management Service</KEYVALUE></KEYBINDING>
  <KEYBINDING NAME="SystemCreationClassName"><KEYVALUE VALUETYPE="string">KVM_HostSystem</KEYVALUE></KEYBINDING>
  <KEYBINDING NAME="SystemName"><KEYVALUE VALUETYPE="string">unknown</KEYVALUE></KEYBINDING>
 </INSTANCENAME>
</LOCALINSTANCEPATH>

<PARAMVALUE NAME="SystemSettings" PARAMTYPE="string">
 <VALUE>
instance of KVM_VirtualSystemSettingData{
 VirtualSystemIdentifier ="test";
 Machine = "fedora";
};
 </VALUE>
</PARAMVALUE>

</METHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>

# wbemexec test_machine.xml 
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLERSP>
<METHODRESPONSE NAME="ModifySystemSettings">
<ERROR CODE="1" DESCRIPTION="CIM_ERR_FAILED: Failed to define domain: XML error: No PCI buses available"/>
</METHODRESPONSE>
</SIMPLERSP>
</MESSAGE>
</CIM>

As we see, libvirtd said "No PCI buses available", the request is rejected.
The domain xml libvirt-cim generated (check it from libvirt log) is:
<domain type='kvm'>
  <name>test</name>
  <on_poweroff>destroy</on_poweroff>
  <on_crash>destroy</on_crash>
  <uuid>1536d0ce-e8e8-11e2-9094-5fff350163f4</uuid>
  <clock offset="utc"/>
  <os>
    <type machine="fedora">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
  </features>
  <currentMemory>1048576</currentMemory>
  <memory dumpCore="on">1048576</memory>
  <vcpu>1</vcpu>
  <cputune>
    <shares>0</shares>
  </cputune>
  <devices>
    <disk type="file" device="disk">
      <driver name="kvm" type="raw" cache="none"/>
      <source file="/tmp/test.img"/>
      <target dev="hda" bus="ide"/>
      <readonly/>
      <shareable/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <target dev="hdc" bus="ide"/>
      <readonly/>
    </disk>
    <input type="tablet" bus="usb"/>
    <input type="mouse" bus="ps2"/>
    <serial type="pty">
      <source/>
      <target port="0"/>
    </serial>
    <console type="pty">
      <source/>
      <target port="0"/>
    </console>
    <graphics type="vnc" port="-1" autoport="yes" listen="127.0.0.1" keymap="en-us"/>
    <emulator>/usr/libexec/qemu-kvm</emulator>
  </devices>
</domain>

This xml generated by libvirt-cim lacks pci controller.

Comment 1 Jincheng Miao 2014-03-13 05:29:54 UTC
Created attachment 873795 [details]
This is xml for wbemexec

Comment 2 John Ferlan 2014-03-19 11:36:14 UTC
I posted some code to the upstream libvirt-cim mail list that should resolve this issue, see:

http://www.redhat.com/archives/libvirt-cim/2014-March/msg00052.html

and follow-ups.  It has not yet been reviewed/accepted, but it does work against the upstream head which also has the same problem with the upstream libvirt head.

However, I am on the fence right now as to whether this is a 7.0 blocker or whether it could be added to a 7.0 z-stream.  My primary concern is that the patches to resolve this particular issue touch the same files as just about every other patch since 0.6.3 shipped.  That would mean I either apply 20+ patches to get the RHEL7.0 sources up to date or I create a RHEL only patch set which is a bit more tricky.

Without patch, the RHEL7.0 libvirt-cim would be a "read only" solution - that is it'd be possible to discover/view libvirt-cim managed domains, but attempting to adjust/modify any of those would fail because no <controller> elements are presented in the XML that libvirt-cim generates to create/update the domain.

Comment 4 John Ferlan 2014-05-14 12:03:48 UTC
Patches were committed to upstream libvirt-cim to support controller and controller pool objects.  These could be backported separately or as a whole eventually for a 7.1 release.

Starting with libvirt-cim commit id '4954aa8c9' through commit id '58d6e308'.  Adjustments were also made to 'cimtest' in order account for new type

Comment 10 Shanzhi Yu 2015-07-28 10:31:10 UTC
Verify this bug with libvirt-cim-0.6.3-19.el7.x86_64
Steps as comment 0. 

#  wbemexec test_machine.xml 
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLERSP>
<METHODRESPONSE NAME="ModifySystemSettings">
<RETURNVALUE PARAMTYPE="uint32">
<VALUE>
0
</VALUE>
</RETURNVALUE>
</METHODRESPONSE>
</SIMPLERSP>
</MESSAGE>
</CIM>

No error show again. 

And from libvirtd.log 

2015-07-28 10:28:07.014+0000: 14208: debug : virDomainDefineXML:6406 : conn=0x7f5de0001c90, xml=<domain type="kvm">
  <name>test</name>
  <on_poweroff>destroy</on_poweroff>
  <on_crash>destroy</on_crash>
  <uuid>1536d0ce-e8e8-11e2-9094-5fff350163f4</uuid>
  <clock offset="utc"/>
  <os>
    <type arch="x86_64" machine="fedora">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
  </features>
..


So the machine type change to fedora.

Comment 11 errata-xmlrpc 2015-11-19 10:18:04 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-2307.html


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