Commit ef14e128 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Fix docstrings for hypervisor functions returning node info



The documentation was out-of-sync with the code.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 006d6bc9
......@@ -239,10 +239,13 @@ class BaseHypervisor(object):
@type hvparams: dict of strings
@param hvparams: hypervisor parameters
@return: a dict with the following keys (values in MiB):
@return: a dict with at least the following keys (memory values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
- cpu_total: total number of CPUs
- cpu_nodes: number of NUMA domains
- cpu_sockets: number of physical CPU sockets
"""
raise NotImplementedError
......@@ -463,7 +466,7 @@ class BaseHypervisor(object):
@staticmethod
def GetLinuxNodeInfo():
"""For linux systems, return actual OS information.
"""For Linux systems, return actual OS information.
This is an abstraction for all non-hypervisor-based classes, where
the node actually sees all the memory and CPUs via the /proc
......@@ -471,10 +474,13 @@ class BaseHypervisor(object):
xen, where you only see the hardware resources via xen-specific
tools.
@return: a dict with the following keys (values in MiB):
@return: a dict with the following keys (memory values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
- cpu_total: total number of CPUs
- cpu_nodes: number of NUMA domains
- cpu_sockets: number of physical CPU sockets
"""
try:
......
#
#
# Copyright (C) 2006, 2007, 2008, 2009 Google Inc.
# Copyright (C) 2006, 2007, 2008, 2009, 2013 Google 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
......@@ -253,15 +253,7 @@ class ChrootManager(hv_base.BaseHypervisor):
def GetNodeInfo(self, hvparams=None):
"""Return information about the node.
This is just a wrapper over the base GetLinuxNodeInfo method.
@type hvparams: dict of strings
@param hvparams: hypervisor parameters, not used in this class
@return: a dict with the following keys (values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
See L{BaseHypervisor.GetLinuxNodeInfo}.
"""
return self.GetLinuxNodeInfo()
......
#
#
# Copyright (C) 2006, 2007, 2008 Google Inc.
# Copyright (C) 2006, 2007, 2008, 2013 Google 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
......@@ -217,15 +217,7 @@ class FakeHypervisor(hv_base.BaseHypervisor):
def GetNodeInfo(self, hvparams=None):
"""Return information about the node.
This is just a wrapper over the base GetLinuxNodeInfo method.
@type hvparams: dict of strings
@param hvparams: hypervisor parameters, not used in this class
@return: a dict with the following keys (values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
See L{BaseHypervisor.GetLinuxNodeInfo}.
"""
result = self.GetLinuxNodeInfo()
......
......@@ -2003,10 +2003,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
@type hvparams: dict of strings
@param hvparams: hypervisor parameters, not used in this class
@return: a dict with the following keys (values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
@return: a dict as returned by L{BaseHypervisor.GetLinuxNodeInfo} plus
the following keys:
- hv_version: the hypervisor version in the form (major, minor,
revision)
......
......@@ -400,15 +400,7 @@ class LXCHypervisor(hv_base.BaseHypervisor):
def GetNodeInfo(self, hvparams=None):
"""Return information about the node.
This is just a wrapper over the base GetLinuxNodeInfo method.
@type hvparams: dict of strings
@param hvparams: hypervisor parameters, not used in this class
@return: a dict with the following keys (values in MiB):
- memory_total: the total memory size on the node
- memory_free: the available memory on the node for instances
- memory_dom0: the memory used by the node itself, if available
See L{BaseHypervisor.GetLinuxNodeInfo}.
"""
return self.GetLinuxNodeInfo()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment