Remove internal only virHostPMCapability enum

The internal virHostPMCapability enum just duplicates the
public virNodeSuspendTarget enum, but with different names.

* src/util/util.c: Use VIR_NODE_SUSPEND_TARGET constants
* src/util/util.h: Remove virHostPMCapability enum
* src/conf/capabilities.c: Use VIR_NODE_SUSPEND_TARGET_LAST
This commit is contained in:
Daniel P. Berrange 2011-11-29 14:11:14 +00:00
parent 866b0a7069
commit 6fb5400fc6
3 changed files with 10 additions and 18 deletions

View File

@ -36,7 +36,7 @@
#define VIR_FROM_THIS VIR_FROM_CAPABILITIES #define VIR_FROM_THIS VIR_FROM_CAPABILITIES
VIR_ENUM_IMPL(virHostPMCapability, VIR_HOST_PM_LAST, VIR_ENUM_IMPL(virHostPMCapability, VIR_NODE_SUSPEND_TARGET_LAST,
"S3", "S4", "Hybrid-Suspend") "S3", "S4", "Hybrid-Suspend")
/** /**

View File

@ -2628,9 +2628,9 @@ virTypedParameterArrayClear(virTypedParameterPtr params, int nparams)
* the query * the query
* @feature: The power management feature to check whether it is supported * @feature: The power management feature to check whether it is supported
* by the host. Values could be: * by the host. Values could be:
* VIR_HOST_PM_S3 for Suspend-to-RAM * VIR_NODE_SUSPEND_TARGET_MEM
* VIR_HOST_PM_S4 for Suspend-to-Disk * VIR_NODE_SUSPEND_TARGET_DISK
* VIR_HOST_PM_HYBRID_SUSPEND for Hybrid-Suspend * VIR_NODE_SUSPEND_TARGET_HYBRID
* *
* Run the script 'pm-is-supported' (from the pm-utils package) * 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 @feature is supported by the host.
@ -2645,13 +2645,13 @@ virDiscoverHostPMFeature(unsigned int *bitmask, unsigned int feature)
int ret = -1; int ret = -1;
switch (feature) { switch (feature) {
case VIR_HOST_PM_S3: case VIR_NODE_SUSPEND_TARGET_MEM:
cmd = virCommandNewArgList("pm-is-supported", "--suspend", NULL); cmd = virCommandNewArgList("pm-is-supported", "--suspend", NULL);
break; break;
case VIR_HOST_PM_S4: case VIR_NODE_SUSPEND_TARGET_DISK:
cmd = virCommandNewArgList("pm-is-supported", "--hibernate", NULL); cmd = virCommandNewArgList("pm-is-supported", "--hibernate", NULL);
break; break;
case VIR_HOST_PM_HYBRID_SUSPEND: case VIR_NODE_SUSPEND_TARGET_HYBRID:
cmd = virCommandNewArgList("pm-is-supported", "--suspend-hybrid", NULL); cmd = virCommandNewArgList("pm-is-supported", "--suspend-hybrid", NULL);
break; break;
default: default:
@ -2695,17 +2695,17 @@ virGetPMCapabilities(unsigned int *bitmask)
*bitmask = 0; *bitmask = 0;
/* Check support for Suspend-to-RAM (S3) */ /* Check support for Suspend-to-RAM (S3) */
ret = virDiscoverHostPMFeature(bitmask, VIR_HOST_PM_S3); ret = virDiscoverHostPMFeature(bitmask, VIR_NODE_SUSPEND_TARGET_MEM);
if (ret < 0) if (ret < 0)
return -1; return -1;
/* Check support for Suspend-to-Disk (S4) */ /* Check support for Suspend-to-Disk (S4) */
ret = virDiscoverHostPMFeature(bitmask, VIR_HOST_PM_S4); ret = virDiscoverHostPMFeature(bitmask, VIR_NODE_SUSPEND_TARGET_DISK);
if (ret < 0) if (ret < 0)
return -1; return -1;
/* Check support for Hybrid-Suspend */ /* Check support for Hybrid-Suspend */
ret = virDiscoverHostPMFeature(bitmask, VIR_HOST_PM_HYBRID_SUSPEND); ret = virDiscoverHostPMFeature(bitmask, VIR_NODE_SUSPEND_TARGET_HYBRID);
if (ret < 0) if (ret < 0)
return -1; return -1;

View File

@ -263,14 +263,6 @@ void virTypedParameterArrayClear(virTypedParameterPtr params, int nparams);
/* Power Management Capabilities of the host system */ /* Power Management Capabilities of the host system */
enum virHostPMCapability {
VIR_HOST_PM_S3, /* Suspend-to-RAM */
VIR_HOST_PM_S4, /* Suspend-to-Disk */
VIR_HOST_PM_HYBRID_SUSPEND, /* Hybrid-Suspend */
VIR_HOST_PM_LAST
};
VIR_ENUM_DECL(virHostPMCapability) VIR_ENUM_DECL(virHostPMCapability)
int virDiscoverHostPMFeature(unsigned int *bitmask, unsigned int feature); int virDiscoverHostPMFeature(unsigned int *bitmask, unsigned int feature);