[virt-tools-list] [virt-manager PATCH] guest: fix order in _XML_PROP_ORDER
Cole Robinson
crobinso at redhat.com
Wed Jun 4 17:57:34 UTC 2014
On 06/04/2014 02:50 AM, Chen Hanxiao wrote:
> re-order xml values according to libvirt code.
>
> a) move "blkiotune" "memtune" ahead of "memoryBacking"
> b) move "resource" ahead of "pm"
>
> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> ---
> .../compare/virt-install-many-devices.xml | 16 ++++++-------
> tests/xmlparse-xml/change-guest-out.xml | 28 +++++++++++-----------
> virtinst/guest.py | 6 ++---
> 3 files changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> index 2136c72..df39c5b 100644
> --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
> +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> @@ -3,10 +3,6 @@
> <uuid>00000000-1111-2222-3333-444444444444</uuid>
> <memory>65536</memory>
> <currentMemory>65536</currentMemory>
> - <vcpu>1</vcpu>
> - <numatune>
> - <memory mode="preferred" nodeset="1-3,5"/>
> - </numatune>
> <blkiotune>
> <weight>200</weight>
> <device>
> @@ -14,6 +10,10 @@
> <weight>300</weight>
> </device>
> </blkiotune>
> + <vcpu>1</vcpu>
> + <numatune>
> + <memory mode="preferred" nodeset="1-3,5"/>
> + </numatune>
> <os>
> <type arch="i686">hvm</type>
> <loader>/foo/bar</loader>
> @@ -148,10 +148,6 @@
> <uuid>00000000-1111-2222-3333-444444444444</uuid>
> <memory>65536</memory>
> <currentMemory>65536</currentMemory>
> - <vcpu>1</vcpu>
> - <numatune>
> - <memory mode="preferred" nodeset="1-3,5"/>
> - </numatune>
> <blkiotune>
> <weight>200</weight>
> <device>
> @@ -159,6 +155,10 @@
> <weight>300</weight>
> </device>
> </blkiotune>
> + <vcpu>1</vcpu>
> + <numatune>
> + <memory mode="preferred" nodeset="1-3,5"/>
> + </numatune>
> <os>
> <type arch="i686">hvm</type>
> <loader>/foo/bar</loader>
> diff --git a/tests/xmlparse-xml/change-guest-out.xml b/tests/xmlparse-xml/change-guest-out.xml
> index e2638bd..c7abcc9 100644
> --- a/tests/xmlparse-xml/change-guest-out.xml
> +++ b/tests/xmlparse-xml/change-guest-out.xml
> @@ -81,20 +81,6 @@
> </seclabel>
> <title>Hey title changed!</title>
> <description>Hey desc changed&</description>
> - <memoryBacking>
> - <hugepages/>
> - <nosharepages/>
> - <locked/>
> - </memoryBacking>
> - <resource>
> - <partition>/virtualmachines/production</partition>
> - </resource>
> - <memtune>
> - <hard_limit>2048</hard_limit>
> - <soft_limit>200</soft_limit>
> - <swap_hard_limit>400</swap_hard_limit>
> - <min_guarantee>500</min_guarantee>
> - </memtune>
> <blkiotune>
> <weight>200</weight>
> <device>
> @@ -102,9 +88,23 @@
> <weight>300</weight>
> </device>
> </blkiotune>
> + <memtune>
> + <hard_limit>2048</hard_limit>
> + <soft_limit>200</soft_limit>
> + <swap_hard_limit>400</swap_hard_limit>
> + <min_guarantee>500</min_guarantee>
> + </memtune>
> + <memoryBacking>
> + <hugepages/>
> + <nosharepages/>
> + <locked/>
> + </memoryBacking>
> <bootloader>pygrub</bootloader>
> <idmap>
> <uid start="0" target="1000" count="10"/>
> <gid start="0" target="1000" count="10"/>
> </idmap>
> + <resource>
> + <partition>/virtualmachines/production</partition>
> + </resource>
> </domain>
> diff --git a/virtinst/guest.py b/virtinst/guest.py
> index a59f59e..5a988f1 100644
> --- a/virtinst/guest.py
> +++ b/virtinst/guest.py
> @@ -94,9 +94,9 @@ class Guest(XMLBuilder):
>
> _XML_ROOT_NAME = "domain"
> _XML_PROP_ORDER = ["type", "name", "uuid", "title", "description",
> - "maxmemory", "memory", "memoryBacking", "vcpus", "resource", "curvcpus",
> - "memtune", "numatune", "blkiotune", "bootloader", "os", "idmap",
> - "features", "cpu", "clock", "on_poweroff", "on_reboot", "on_crash", "pm",
> + "maxmemory", "memory", "blkiotune", "memtune", "memoryBacking",
> + "vcpus", "curvcpus", "numatune", "bootloader", "os", "idmap", "features",
> + "cpu", "clock", "on_poweroff", "on_reboot", "on_crash", "resource", "pm",
> "emulator", "_devices", "seclabel"]
>
> def __init__(self, *args, **kwargs):
>
ACK
- Cole
More information about the virt-tools-list
mailing list