Change in vdsm[master]: faqemu: fix

mpolednik at redhat.com mpolednik at redhat.com
Sat Oct 3 17:50:47 UTC 2015


Martin Polednik has uploaded a new change for review.

Change subject: faqemu: fix
......................................................................

faqemu: fix

Change-Id: Ied7aeee26972c12abff6e0453c8c877494f5d526
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M vdsm/virt/vmxml.py
M vdsm_hooks/faqemu/before_vm_start.py
2 files changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/46960/1

diff --git a/vdsm/virt/vmxml.py b/vdsm/virt/vmxml.py
index 2b92a3a..a17f974 100644
--- a/vdsm/virt/vmxml.py
+++ b/vdsm/virt/vmxml.py
@@ -253,7 +253,7 @@
 
         machine = self.conf.get('emulatedMachine', DEFAULT_MACHINES[self.arch])
 
-        oselem.appendChildWithArgs('type', text='hvm', arch=self.arch,
+        oselem.appendChildWithArgs('type', text='hvm', arch=cpuinfo.arch(),
                                    machine=machine)
 
         qemu2libvirtBoot = {'a': 'fd', 'c': 'hd', 'd': 'cdrom', 'n': 'network'}
diff --git a/vdsm_hooks/faqemu/before_vm_start.py b/vdsm_hooks/faqemu/before_vm_start.py
index 73a1d05..2755092 100644
--- a/vdsm_hooks/faqemu/before_vm_start.py
+++ b/vdsm_hooks/faqemu/before_vm_start.py
@@ -40,6 +40,15 @@
             memvalue.appendChild(domxml.createTextNode(memory))
 
     for cputag in domxml.getElementsByTagName("cpu"):
-        cputag.parentNode.removeChild(cputag)
+        for modeltag in cputag.getElementsByTagName('model'):
+            cputag.removeChild(modeltag)
+
+    for controllertag in domxml.getElementsByTagName("controller"):
+        for child in controllertag.childNodes:
+            try:
+                if child.getAttribute('type') == 'spapr-vio':
+                    child.parentNode.removeChild(child)
+            except AttributeError:
+                continue
 
     hooking.write_domxml(domxml)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied7aeee26972c12abff6e0453c8c877494f5d526
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