Revision 34fbc862 lib/hypervisor/hv_xen.py
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
257 | 257 |
- nr_cpus: total number of CPUs |
258 | 258 |
- nr_nodes: in a NUMA system, the number of domains |
259 | 259 |
- nr_sockets: the number of physical CPU sockets in the node |
260 |
- hv_version: the hypervisor version in the form (major, minor) |
|
260 | 261 |
|
261 | 262 |
""" |
262 | 263 |
# note: in xen 3, memory has changed to total_memory |
... | ... | |
269 | 270 |
xmoutput = result.stdout.splitlines() |
270 | 271 |
result = {} |
271 | 272 |
cores_per_socket = threads_per_core = nr_cpus = None |
273 |
xen_major, xen_minor = None, None |
|
272 | 274 |
for line in xmoutput: |
273 | 275 |
splitfields = line.split(":", 1) |
274 | 276 |
|
... | ... | |
287 | 289 |
cores_per_socket = int(val) |
288 | 290 |
elif key == "threads_per_core": |
289 | 291 |
threads_per_core = int(val) |
292 |
elif key == "xen_major": |
|
293 |
xen_major = int(val) |
|
294 |
elif key == "xen_minor": |
|
295 |
xen_minor = int(val) |
|
290 | 296 |
|
291 | 297 |
if (cores_per_socket is not None and |
292 | 298 |
threads_per_core is not None and nr_cpus is not None): |
... | ... | |
296 | 302 |
if dom0_info is not None: |
297 | 303 |
result["memory_dom0"] = dom0_info[2] |
298 | 304 |
|
305 |
if not (xen_major is None or xen_minor is None): |
|
306 |
result[constants.HV_NODEINFO_KEY_VERSION] = (xen_major, xen_minor) |
|
307 |
|
|
299 | 308 |
return result |
300 | 309 |
|
301 | 310 |
@classmethod |
Also available in: Unified diff