Royce Lv has uploaded a new change for review.
Change subject: add emulator pin support to create vm
......................................................................
add emulator pin support to create vm
move cpupin to a seperate function 'appendTunable'
to add cputune(e.g.cpu_share),memtune limit def when create vm.
add emulator pin support to create vm,
then the cpuPinning dict changs to be:
{0:'1-4','emulator':'2'}
Change-Id: Ic616b825eca94682e1563ab51773d8a23351998d
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/libvirtvm.py
1 file changed, 21 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/8411/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 64a3b6b..fd80c69 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -716,18 +716,6 @@
topo.setAttribute('threads', str(threads))
cpu.appendChild(topo)
- #CPU-pinning support
- # see
http://www.ovirt.org/wiki/Features/Design/cpu-pinning
- if 'cpuPinning' in self.conf:
- cputune = self.doc.createElement('cputune')
- cpuPinning = self.conf.get('cpuPinning')
- for cpuPin in cpuPinning.keys():
- vcpupin = self.doc.createElement('vcpupin')
- vcpupin.setAttribute('vcpu', cpuPin)
- vcpupin.setAttribute('cpuset', cpuPinning[cpuPin])
- cputune.appendChild(vcpupin)
- self.dom.appendChild(cputune)
-
# This hack is for backward compatibility as the libvirt does not allow
# 'qemu64' guest on intel hardware
if model == 'qemu64' and not '+svm' in features:
@@ -747,6 +735,26 @@
f.setAttribute('name', feature[1:])
cpu.appendChild(f)
self.dom.appendChild(cpu)
+
+ def appendTunable(self):
+ #CPU-pinning support
+ # see
http://www.ovirt.org/wiki/Features/Design/cpu-pinning
+ if 'cpuPinning' in self.conf:
+ cputune = self.doc.createElement('cputune')
+ cpuPinning = self.conf.get('cpuPinning')
+ try:
+ emulatorset = cpuPinning.pop('emulator')
+ emulatorpin = self.doc.createElement('emulatorpin')
+ emulatorpin.setAttribute('cpuset', emulatorset)
+ cputune.appendChild(emulatorpin)
+ except:
+ pass
+ for cpuPin in cpuPinning.keys():
+ vcpupin = self.doc.createElement('vcpupin')
+ vcpupin.setAttribute('vcpu', cpuPin)
+ vcpupin.setAttribute('cpuset', cpuPinning[cpuPin])
+ cputune.appendChild(vcpupin)
+ self.dom.appendChild(cputune)
def _appendAgentDevice(self, path, name):
"""
@@ -1230,6 +1238,7 @@
domxml.appendClock()
domxml.appendFeatures()
domxml.appendCpu()
+ domxml.appendTunable()
if utils.tobool(self.conf.get('vmchannel', 'true')):
domxml._appendAgentDevice(
self._guestSocketFile.decode('utf-8'),
--
To view, visit
http://gerrit.ovirt.org/8411
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic616b825eca94682e1563ab51773d8a23351998d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>