'<nosharedpages/>' in xml is not recognized by libvirt.

Bug #1469634 reported by Charlotte Han
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Unassigned

Bug Description

'<nosharedpages/>' in xml is not recognized by libvirt. We should modify "nosharedpages" to "nosharepages".

Because:
[root@nail-SBCJ-5-3-3 libvirt]# virsh list
 Id Name State
----------------------------------------------------
 2 instance-00000002 running
 7 instance-00000007 running

[root@nail-SBCJ-5-3-3 libvirt]#
[root@nail-SBCJ-5-3-3 libvirt]#
[root@nail-SBCJ-5-3-3 libvirt]# virsh dumpxml 7
<domain type='kvm' id='7'>
  <name>instance-00000007</name>
  <uuid>dda65962-5d55-403a-bdf3-462a17563a74</uuid>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="2015.1.0-1.1.44"/>
      <nova:name>hanrong5</nova:name>
      <nova:creationTime>2015-06-29 07:30:51</nova:creationTime>
      <nova:flavor name="hanrong">
        <nova:memory>100</nova:memory>
        <nova:disk>10</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>1</nova:vcpus>
      </nova:flavor>
      <nova:owner>
        <nova:user uuid="84ee57c242ca41f09d8a833adc2e2583">admin</nova:user>
        <nova:project uuid="e35fbf4375b346519d86e2200047ad0e">admin</nova:project>
      </nova:owner>
      <nova:root type="image" uuid="e164982b-e53a-4beb-bc69-f660643dce87"/>
    </nova:instance>
  </metadata>
  <memory unit='KiB'>102400</memory>
  <currentMemory unit='KiB'>102400</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static' cpuset='0-3,8-11'>1</vcpu>
  <cputune>
    <shares>1024</shares>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>Fedora Project</entry>
      <entry name='product'>OpenStack Nova</entry>
      <entry name='version'>2015.1.0-1.1.44</entry>
      <entry name='serial'>52c08ef4-27eb-422d-a840-7de43ca69827</entry>
      <entry name='uuid'>dda65962-5d55-403a-bdf3-462a17563a74</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='i686' machine='pc-i440fx-2.2'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
    <apic eoi='on'/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/nova/instances/dda65962-5d55-403a-bdf3-462a17563a74/disk'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
        <source file='/var/lib/nova/instances/_base/bc3b6a5811a9095948b287f8e145dd833eb4779c'/>
        <backingStore/>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <interface type='bridge'>
      <mac address='fa:16:3e:61:0b:a9'/>
      <source bridge='qbr2f305d6a-81'/>
      <dpdk use='false' port='0'/>
      <target dev='tap2f305d6a-81'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='file'>
      <source path='/var/lib/nova/instances/dda65962-5d55-403a-bdf3-462a17563a74/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/6'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/dda65962-5d55-403a-bdf3-462a17563a74/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <stats period='10'/>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Revision history for this message
Charlotte Han (hanrong) wrote :

Although this '<nosharedpages/>' is not occured in libvirt.xml, but the code is not correct.

class LibvirtConfigGuestMemoryBacking(LibvirtConfigObject):

    def __init__(self, **kwargs):
        super(LibvirtConfigGuestMemoryBacking, self).__init__(
            root_name="memoryBacking", **kwargs)

        self.hugepages = []
        self.sharedpages = True
        self.locked = False

    def format_dom(self):
        root = super(LibvirtConfigGuestMemoryBacking, self).format_dom()

        if self.hugepages:
            hugepages = etree.Element("hugepages")
            for item in self.hugepages:
                hugepages.append(item.format_dom())
            root.append(hugepages)
        if not self.sharedpages:
            root.append(etree.Element("nosharepages"))
        if self.locked:
            root.append(etree.Element("locked"))

        return root

tags: added: in-stable-kilo
Revision history for this message
Charlotte Han (hanrong) wrote :

if not self.sharedpages:
            root.append(etree.Element("nosharedpages"))

should be modified by:

if not self.sharedpages:
            root.append(etree.Element("nosharepages"))

Revision history for this message
Tony Breeds (o-tony) wrote :

Hmm based on the libvirt source this seems to be valid:
---
alder:libvirt tony8129$ git grep -l nosharedpages
balder:libvirt tony8129$ git grep -l nosharepages
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_command.c
tests/qemuargv2xmltest.c
tests/qemuxml2argvdata/qemuxml2argv-nosharepages.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c
balder:libvirt tony8129$ git describe
v1.2.17-rc1-19-g04597f8
---

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Changed in nova:
assignee: nobody → Tony Breeds (o-tony)
status: Confirmed → In Progress
Charlotte Han (hanrong)
Changed in nova:
assignee: Tony Breeds (o-tony) → Rong Han ZTE (hanrong)
Charlotte Han (hanrong)
Changed in nova:
assignee: Rong Han ZTE (hanrong) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Rong Han (<email address hidden>) on branch: master
Review: https://review.openstack.org/197480
Reason: duplicate

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Rong Han (<email address hidden>) on branch: master
Review: https://review.openstack.org/197486
Reason: duplicate

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote : Cleanup

Solving an inconsistency: The bug is 'In Progress' but without an assignee. I set the status back to the last known status before the change to 'In Progress'.

Feel free to assign the bug to yourself. If you do so, please set it to 'In Progress'.

Changed in nova:
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → lyanchih (lyanchih)
status: Confirmed → In Progress
Revision history for this message
Charlotte Han (hanrong) wrote :

 https://review.openstack.org/#/c/197398/

the code is commited, but this relationship has not been displayed.

Revision history for this message
Charlotte Han (hanrong) wrote :

So, I abandoned my commited code :https://review.openstack.org/197486.

because it is the same as https://review.openstack.org/#/c/197398/

Revision history for this message
Chung Chih, Hung (lyanchih) wrote :

Tony Breeds had committed review
https://review.openstack.org/#/c/197398/

Changed in nova:
assignee: lyanchih (lyanchih) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/197398
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=366ed498497cc08983cf067f908d97fb72f894ab
Submitter: Jenkins
Branch: master

commit 366ed498497cc08983cf067f908d97fb72f894ab
Author: Tony Breeds <email address hidden>
Date: Wed Jul 1 12:18:05 2015 +1000

    libvirt: Correct domxml node name.

    It seems that the wrong (possibly old?) domain xml node is used.

    The libvirt ssource shows:
    balder:libvirt$ git grep -l nosharedpages
    balder:libvirt$ git grep -l nosharepages
    docs/formatdomain.html.in
    docs/schemas/domaincommon.rng
    src/conf/domain_conf.c
    src/conf/domain_conf.h
    src/qemu/qemu_command.c
    tests/qemuargv2xmltest.c
    tests/qemuxml2argvdata/qemuxml2argv-nosharepages.xml
    tests/qemuxml2argvtest.c
    tests/qemuxml2xmltest.c
    balder:libvirt$ git describe
    v1.2.17-rc1-19-g04597f8
    ---

    Use the correct node name.

    Change-Id: I87b7700d15bad49f474c54da110418eaf67214dc
    Closes-Bug: 1469634

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-2 → 12.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.