Change in vdsm[master]: virt: delay appendFeatures and appendClock

mpolednik at redhat.com mpolednik at redhat.com
Tue May 3 13:29:10 UTC 2016


Martin Polednik has uploaded a new change for review.

Change subject: virt: delay appendFeatures and appendClock
......................................................................

virt: delay appendFeatures and appendClock

This patch itself does not provide much value, but it is a preparation
for upcoming change. We move appendFeatures and appendClock to the
bottom of domain XML building to have all devices setup by the time we
get there.

That means, flags/timers depending on device configuration can
access the created device objects.

Change-Id: I4c3a719b57978a7f7adc0f0845c706e3c525574b
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M tests/vmTestsData.py
M vdsm/virt/vm.py
2 files changed, 20 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/56974/1

diff --git a/tests/vmTestsData.py b/tests/vmTestsData.py
index 00f39e2..d039095 100644
--- a/tests/vmTestsData.py
+++ b/tests/vmTestsData.py
@@ -68,6 +68,13 @@
                         <entry name="uuid">%(vmId)s</entry>
                     </system>
                 </sysinfo>
+                <cputune/>
+                <cpu match="exact">
+                    <model>qemu64</model>
+                    <feature name="svm" policy="disable"/>
+                    <topology cores="1" sockets="160" threads="1"/>
+                    <numa/>
+                </cpu>
                 <clock adjustment="0" offset="variable">
                     <timer name="rtc" tickpolicy="catchup"/>
                     <timer name="pit" tickpolicy="delay"/>
@@ -76,13 +83,6 @@
                 <features>
                     <acpi/>
                 </features>
-                <cputune/>
-                <cpu match="exact">
-                    <model>qemu64</model>
-                    <feature name="svm" policy="disable"/>
-                    <topology cores="1" sockets="160" threads="1"/>
-                    <numa/>
-                </cpu>
             </domain>
 """, )]
 
@@ -127,16 +127,16 @@
                 <os>
                     <type arch="ppc64" machine="pc">hvm</type>
                 </os>
-                <clock adjustment="0" offset="variable">
-                    <timer name="rtc" tickpolicy="catchup"/>
-                    <timer name="pit" tickpolicy="delay"/>
-                </clock>
                 <cputune/>
                 <cpu>
                     <model>POWER8</model>
                     <topology cores="1" sockets="160" threads="1"/>
                     <numa/>
                 </cpu>
+                <clock adjustment="0" offset="variable">
+                    <timer name="rtc" tickpolicy="catchup"/>
+                    <timer name="pit" tickpolicy="delay"/>
+                </clock>
             </domain>
 """, )]
 
@@ -198,6 +198,10 @@
                 <entry name="uuid">%(vmId)s</entry>
             </system>
         </sysinfo>
+        <cpu match="exact">
+            <model>SandyBridge</model>
+            <topology cores="1" sockets="160" threads="1"/>
+        </cpu>
         <clock adjustment="0" offset="variable">
             <timer name="rtc" tickpolicy="catchup"/>
             <timer name="pit" tickpolicy="delay"/>
@@ -206,10 +210,6 @@
         <features>
             <acpi/>
         </features>
-        <cpu match="exact">
-            <model>SandyBridge</model>
-            <topology cores="1" sockets="160" threads="1"/>
-        </cpu>
     </domain>
 """, )]
 
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 8ac6242..41b18c3 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1661,11 +1661,6 @@
                 osversion=osVersion,
                 serialNumber=serialNumber)
 
-        domxml.appendClock()
-
-        if cpuarch.is_x86(self.arch):
-            domxml.appendFeatures()
-
         domxml.appendCpu()
 
         domxml.appendNumaTune()
@@ -1693,6 +1688,11 @@
             for leaseElement in drive.getLeasesXML():
                 domxml._devices.appendChild(leaseElement)
 
+        domxml.appendClock()
+
+        if cpuarch.is_x86(self.arch):
+            domxml.appendFeatures()
+
         return domxml.toxml()
 
     def _cleanup(self):


-- 
To view, visit https://gerrit.ovirt.org/56974
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c3a719b57978a7f7adc0f0845c706e3c525574b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>


More information about the vdsm-patches mailing list