On 11/29/2011 09:14 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Rename virGetPMCapabilities to virNodeSuspendGetTargetMask and
virDiscoverHostPMFeature to virNodeSuspendSupportsTarget.
* src/util/util.c, src/util/util.h: Rename APIs
* src/qemu/qemu_capabilities.c, src/util/virnodesuspend.c: Adjust
for new names
---
src/qemu/qemu_capabilities.c | 2 +-
src/util/util.c | 22 +++++++++++-----------
src/util/util.h | 4 ++--
src/util/virnodesuspend.c | 2 +-
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c5fe41d..4bbfd78 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -850,7 +850,7 @@ virCapsPtr qemuCapsInit(virCapsPtr old_caps)
/* Add the power management features of the host */
- if (virGetPMCapabilities(&caps->host.powerMgmt) < 0) {
+ if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) {
VIR_WARN("Failed to get host power management capabilities");
caps->host.powerMgmt_valid = false;
} else
diff --git a/src/util/util.c b/src/util/util.c
index badfa3a..72fbdac 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -2623,8 +2623,8 @@ virTypedParameterArrayClear(virTypedParameterPtr params, int
nparams)
}
/**
- * virDiscoverHostPMFeature:
- * @feature: The power management feature to check whether it is supported
+ * virNodeSuspendSupportsTarget:
+ * @target: The power management target to check whether it is supported
* by the host. Values could be:
* VIR_NODE_SUSPEND_TARGET_MEM
* VIR_NODE_SUSPEND_TARGET_DISK
@@ -2632,12 +2632,12 @@ virTypedParameterArrayClear(virTypedParameterPtr params, int
nparams)
* @supported: set to true if supported, false otherwise
*
* Run the script 'pm-is-supported' (from the pm-utils package)
- * to find out if @feature is supported by the host.
+ * to find out if @target is supported by the host.
*
* Returns 0 if the query was successful, -1 on failure.
*/
int
-virDiscoverHostPMFeature(unsigned int feature, bool *supported)
+virNodeSuspendSupportsTarget(unsigned int target, bool *supported)
{
virCommandPtr cmd;
int status;
@@ -2645,7 +2645,7 @@ virDiscoverHostPMFeature(unsigned int feature, bool *supported)
*supported = false;
- switch (feature) {
+ switch (target) {
case VIR_NODE_SUSPEND_TARGET_MEM:
cmd = virCommandNewArgList("pm-is-supported", "--suspend",
NULL);
break;
@@ -2675,19 +2675,19 @@ cleanup:
}
/**
- * virGetPMCapabilities:
+ * virNodeSuspendGetTargetMask:
*
* Get the Power Management Capabilities that the host system supports,
* such as Suspend-to-RAM (S3), Suspend-to-Disk (S4) and Hybrid-Suspend
* (a combination of S3 and S4).
*
You might want to remove the terminology "S3", "S4" etc from here,
perhaps?
--
Regards,
Srivatsa S. Bhat
IBM Linux Technology Center