From bf878aa97ef169e9c0cc4dcd7a1b27cce0eb2cc5 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 21 Aug 2009 14:16:13 +0200 Subject: [PATCH] Fix up virNodeGetCellsFreeMemory The documentation for virNodeGetCellsFreeMemory claims the values returned are in kilobytes, but that's actually wrong; the value returned is actually in bytes. Fix up the documentation to be correct. Signed-off-by: Chris Lalancette --- docs/devhelp/libvirt-libvirt.html | 2 +- docs/html/libvirt-libvirt.html | 2 +- docs/libvirt-api.xml | 2 +- docs/libvirt-refs.xml | 1 - src/libvirt.c | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/devhelp/libvirt-libvirt.html b/docs/devhelp/libvirt-libvirt.html index 0ac96d54e5..4f2f774038 100644 --- a/docs/devhelp/libvirt-libvirt.html +++ b/docs/devhelp/libvirt-libvirt.html @@ -1315,7 +1315,7 @@ The content of this structure is not made public by the API.
dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeGetCellsFreeMemory ()

int	virNodeGetCellsFreeMemory	(virConnectPtr conn, 
unsigned long long * freeMems,
int startCell,
int maxCells)
-

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

+

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in bytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

conn:pointer to the hypervisor connection
freeMems:pointer to the array of unsigned long long
startCell:index of first cell to return freeMems info on.
maxCells:Maximum number of cells for which freeMems information can be returned.
Returns:the number of entries filled in freeMems, or -1 in case of error.

virNodeGetFreeMemory ()

unsigned long long	virNodeGetFreeMemory	(virConnectPtr conn)
diff --git a/docs/html/libvirt-libvirt.html b/docs/html/libvirt-libvirt.html index aeba99aea8..748861fdf3 100644 --- a/docs/html/libvirt-libvirt.html +++ b/docs/html/libvirt-libvirt.html @@ -517,7 +517,7 @@ int virStorageVolRef (
dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeDeviceRef

int	virNodeDeviceRef		(virNodeDevicePtr dev)

Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to virNodeDeviceFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a dev would increment the reference count.

dev:the dev to hold a reference on
Returns:0 in case of success, -1 in case of failure.

virNodeDeviceReset

int	virNodeDeviceReset		(virNodeDevicePtr dev)

Reset a previously dettached node device to the node before or after assigning it to a guest. The exact reset semantics depends on the hypervisor and device type but, for example, KVM will attempt to reset PCI devices with a Function Level Reset, Secondary Bus Reset or a Power Management D-State reset. If the reset will affect other devices which are currently in use, this function may fail.

dev:pointer to the node device
Returns:0 in case of success, -1 in case of failure.

virNodeGetCellsFreeMemory

int	virNodeGetCellsFreeMemory	(virConnectPtr conn, 
unsigned long long * freeMems,
int startCell,
int maxCells)
-

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

conn:pointer to the hypervisor connection
freeMems:pointer to the array of unsigned long long
startCell:index of first cell to return freeMems info on.
maxCells:Maximum number of cells for which freeMems information can be returned.
Returns:the number of entries filled in freeMems, or -1 in case of error.

virNodeGetFreeMemory

unsigned long long	virNodeGetFreeMemory	(virConnectPtr conn)
+

This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in bytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.

conn:pointer to the hypervisor connection
freeMems:pointer to the array of unsigned long long
startCell:index of first cell to return freeMems info on.
maxCells:Maximum number of cells for which freeMems information can be returned.
Returns:the number of entries filled in freeMems, or -1 in case of error.

virNodeGetFreeMemory

unsigned long long	virNodeGetFreeMemory	(virConnectPtr conn)

provides the free memory available on the Node Note: most libvirt APIs provide memory sizes in kilobytes, but in this function the returned value is in bytes. Divide by 1024 as necessary.

conn:pointer to the hypervisor connection
Returns:the available free memory in bytes or 0 in case of error

virNodeGetInfo

int	virNodeGetInfo			(virConnectPtr conn, 
virNodeInfoPtr info)

Extract hardware information about the node.

conn:pointer to the hypervisor connection
info:pointer to a virNodeInfo structure allocated by the user
Returns:0 in case of success and -1 in case of failure.

virNodeGetSecurityModel

int	virNodeGetSecurityModel		(virConnectPtr conn, 
virSecurityModelPtr secmodel)

Extract the security model of a hypervisor. The 'model' field in the @secmodel argument may be initialized to the empty string if the driver has not activated a security model.

conn:a connection object
secmodel:pointer to a virSecurityModel structure
Returns:0 in case of success, -1 in case of failure

virNodeListDevices

int	virNodeListDevices		(virConnectPtr conn, 
const char * cap,
char ** const names,
int maxnames,
unsigned int flags)
diff --git a/docs/libvirt-api.xml b/docs/libvirt-api.xml index 0d244eab92..cbf0916a9b 100644 --- a/docs/libvirt-api.xml +++ b/docs/libvirt-api.xml @@ -1723,7 +1723,7 @@ see note above'/> - This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller. + This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in bytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller. diff --git a/docs/libvirt-refs.xml b/docs/libvirt-refs.xml index 0bceb63dac..cfa31bf052 100644 --- a/docs/libvirt-refs.xml +++ b/docs/libvirt-refs.xml @@ -4645,7 +4645,6 @@ - diff --git a/src/libvirt.c b/src/libvirt.c index ca8e00394d..6cf56ccd58 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -4615,7 +4615,7 @@ error: * * This call returns the amount of free memory in one or more NUMA cells. * The @freeMems array must be allocated by the caller and will be filled - * with the amount of free memory in kilobytes for each cell requested, + * with the amount of free memory in bytes for each cell requested, * starting with startCell (in freeMems[0]), up to either * (startCell + maxCells), or the number of additional cells in the node, * whichever is smaller. -- GitLab