Browse code

Merge "remove addition of gate64 cpu"

Jenkins authored on 2016/06/04 11:22:39
Showing 2 changed files
... ...
@@ -121,18 +121,9 @@ EOF
121 121
         fi
122 122
     fi
123 123
 
124
-    # Update the libvirt cpu map with a gate64 cpu model. This enables nova
125
-    # live migration for 64bit guest OSes on heterogenous cloud "hardware".
126
-    if [[ -f /usr/share/libvirt/cpu_map.xml ]] ; then
127
-        sudo $TOP_DIR/tools/cpu_map_update.py /usr/share/libvirt/cpu_map.xml
128
-    fi
129
-
130
-    # libvirt detects various settings on startup, as we potentially changed
131
-    # the system configuration (modules, filesystems), we need to restart
132
-    # libvirt to detect those changes. Use a stop start as otherwise the new
133
-    # cpu_map is not loaded properly on some systems (Ubuntu).
134
-    stop_service $LIBVIRT_DAEMON
135
-    start_service $LIBVIRT_DAEMON
124
+    # Service needs to be started on redhat/fedora -- do a restart for
125
+    # sanity after fiddling the config.
126
+    restart_service $LIBVIRT_DAEMON
136 127
 }
137 128
 
138 129
 
139 130
deleted file mode 100755
... ...
@@ -1,88 +0,0 @@
1
-#!/usr/bin/env python
2
-#
3
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
-# not use this file except in compliance with the License. You may obtain
5
-# a copy of the License at
6
-#
7
-#      http://www.apache.org/licenses/LICENSE-2.0
8
-#
9
-# Unless required by applicable law or agreed to in writing, software
10
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
-# License for the specific language governing permissions and limitations
13
-# under the License.
14
-
15
-# This small script updates the libvirt CPU map to add a gate64 cpu model
16
-# that can be used to enable a common 64bit capable feature set across
17
-# devstack nodes so that features like nova live migration work.
18
-
19
-import sys
20
-import xml.etree.ElementTree as ET
21
-from xml.dom import minidom
22
-
23
-
24
-def update_cpu_map(tree):
25
-    root = tree.getroot()
26
-    cpus = root#.find("cpus")
27
-    x86 = None
28
-    for arch in cpus.findall("arch"):
29
-        if arch.get("name") == "x86":
30
-            x86 = arch
31
-            break
32
-    if x86 is not None:
33
-        # Create a gate64 cpu model that is core2duo less monitor, pse36,
34
-        # vme, and ssse3.
35
-        gate64 = ET.SubElement(x86, "model")
36
-        gate64.set("name", "gate64")
37
-        ET.SubElement(gate64, "vendor").set("name", "Intel")
38
-        ET.SubElement(gate64, "feature").set("name", "fpu")
39
-        ET.SubElement(gate64, "feature").set("name", "de")
40
-        ET.SubElement(gate64, "feature").set("name", "pse")
41
-        ET.SubElement(gate64, "feature").set("name", "tsc")
42
-        ET.SubElement(gate64, "feature").set("name", "msr")
43
-        ET.SubElement(gate64, "feature").set("name", "pae")
44
-        ET.SubElement(gate64, "feature").set("name", "mce")
45
-        ET.SubElement(gate64, "feature").set("name", "cx8")
46
-        ET.SubElement(gate64, "feature").set("name", "apic")
47
-        ET.SubElement(gate64, "feature").set("name", "sep")
48
-        ET.SubElement(gate64, "feature").set("name", "pge")
49
-        ET.SubElement(gate64, "feature").set("name", "cmov")
50
-        ET.SubElement(gate64, "feature").set("name", "pat")
51
-        ET.SubElement(gate64, "feature").set("name", "mmx")
52
-        ET.SubElement(gate64, "feature").set("name", "fxsr")
53
-        ET.SubElement(gate64, "feature").set("name", "sse")
54
-        ET.SubElement(gate64, "feature").set("name", "sse2")
55
-        ET.SubElement(gate64, "feature").set("name", "mtrr")
56
-        ET.SubElement(gate64, "feature").set("name", "mca")
57
-        ET.SubElement(gate64, "feature").set("name", "clflush")
58
-        ET.SubElement(gate64, "feature").set("name", "pni")
59
-        ET.SubElement(gate64, "feature").set("name", "nx")
60
-        ET.SubElement(gate64, "feature").set("name", "syscall")
61
-        ET.SubElement(gate64, "feature").set("name", "lm")
62
-
63
-
64
-def format_xml(root):
65
-    # Adapted from http://pymotw.com/2/xml/etree/ElementTree/create.html
66
-    # thank you dhellmann
67
-    rough_string = ET.tostring(root, encoding="UTF-8")
68
-    dom_parsed = minidom.parseString(rough_string)
69
-    return dom_parsed.toprettyxml("  ", encoding="UTF-8")
70
-
71
-
72
-def main():
73
-    if len(sys.argv) != 2:
74
-        raise Exception("Must pass path to cpu_map.xml to update")
75
-    cpu_map = sys.argv[1]
76
-    tree = ET.parse(cpu_map)
77
-    for model in tree.getroot().iter("model"):
78
-        if model.get("name") == "gate64":
79
-            # gate64 model is already present
80
-            return
81
-    update_cpu_map(tree)
82
-    pretty_xml = format_xml(tree.getroot())
83
-    with open(cpu_map, 'w') as f:
84
-        f.write(pretty_xml)
85
-
86
-
87
-if __name__ == "__main__":
88
-    main()