Zhou Zheng Sheng has posted comments on this change.
Change subject: extract a method for appending a child node with a text node to self.dom
in libvirtvm.py
......................................................................
Patch Set 1: Verified
Run through autobuild.sh, but I disable two tests, testAddNetworkValidation and
test_mkFloppyFs. These two tests will fail on my machine when I checkout the latest master
and build.
And I further verify it by importing the module in the interpreter and examine the
generated XML string. I just changed the way of generating name, uuid, memory,
currentMemory, vcpu, and acpi, so I only check the related configurations and output XML
string. The detailed conversation with Python interpreter is as follow.
[edward@zhshzhouf17 builder]$
PYTHONPATH=$(pwd)/share/vdsm:$(pwd)/lib64/python2.7/site-packages:/usr/lib64/python2.7/site-packages
python
Python 2.7.3 (default, Apr 30 2012, 21:18:11)
[GCC 4.7.0 20120416 (Red Hat 4.7.0-2)] on linux2
Type "help", "copyright", "credits" or "license"
for more information.
>> from libvirtvm import _DomXML as DomXML
>> d = {'acpiEnable': 'True',
... 'smp':
'2',
... 'vmId': '209b27e4-aed3-11e1-a547-00247edb4743',
... 'memSize': 128,
... 'vmName': 'rhel6vdsm'}
>> domxml = DomXML(d, None)
{'vmName':
'rhel6vdsm', 'memSize': 128, 'vmId':
'209b27e4-aed3-11e1-a547-00247edb4743', 'acpiEnable': 'True',
'smp': '2'}
>> print domxml.toxml()
<?xml version="1.0"
encoding="utf-8"?>
<domain type="kvm">
<name>rhel6vdsm</name>
<uuid>209b27e4-aed3-11e1-a547-00247edb4743</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>2</vcpu>
<devices/>
</domain>
The generated XML string looks OK.
--
To view, visit
http://gerrit.ovirt.org/6846
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie05d8f0f9869080b34d5cafb5c672d4034f09934
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>