Change in vdsm[master]: nestedvt: set CPU host-passthrough mode when enabled

mpolednik at redhat.com mpolednik at redhat.com
Wed Jan 13 08:06:28 UTC 2016


Martin Polednik has uploaded a new change for review.

Change subject: nestedvt: set CPU host-passthrough mode when enabled
......................................................................

nestedvt: set CPU host-passthrough mode when enabled

Nested KVM requires the VMS/VMX flag to be passed from host CPU to the
guest (virtual) CPU. This is done by requiring correct feature to be
present AND using pass-through mode for the virtual CPU. This patch
allows hook to automatically configure the host-passthrough part.

Change-Id: I334b2f9aed6c0b0dd823823f2560cbdeade5b8e1
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M vdsm_hooks/nestedvt/before_vm_start.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/51764/1

diff --git a/vdsm_hooks/nestedvt/before_vm_start.py b/vdsm_hooks/nestedvt/before_vm_start.py
index 5ea71f4..41f0689 100755
--- a/vdsm_hooks/nestedvt/before_vm_start.py
+++ b/vdsm_hooks/nestedvt/before_vm_start.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright 2012 Red Hat, Inc.
+# Copyright 2012-2013, 2016 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -42,5 +42,7 @@
     feature_vmx = domxml.createElement("feature")
     feature_vmx.setAttribute("name", cpu_nested_features[kvm_mod])
     feature_vmx.setAttribute("policy", "require")
-    domxml.getElementsByTagName("cpu")[0].appendChild(feature_vmx)
+    cpu = domxml.getElementsByTagName("cpu")[0]
+    cpu.setAttribute('mode', 'host-passthrough')
+    cpu.appendChild(feature_vmx)
     hooking.write_domxml(domxml)


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

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