esxPrivate *priv = conn->privateData;
esxVI_Boolean supportsVMotion = esxVI_Boolean_Undefined;
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_V1:
supportsVMotion = esxSupportsVMotion(priv);
return priv->vCenter &&
supportsVMotion == esxVI_Boolean_True ? 1 : 0;
- default:
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_P2P:
+ case VIR_DRV_FEATURE_MIGRATION_PARAMS:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_MIGRATION_V3:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
+ default:
return 0;
}
}
* feature. Queries for VIR_DRV_FEATURE_PROGRAM* features are answered
* directly by the RPC layer and not by the real driver.
*/
-enum {
+typedef enum {
/* Driver supports V1-style virDomainMigrate, ie. domainMigratePrepare/
* domainMigratePerform/domainMigrateFinish.
*/
* Support for driver close callback rpc
*/
VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK = 15,
-};
+} virDrvFeature;
int virConnectSupportsFeature(virConnectPtr conn, int feature);
if (virConnectSupportsFeatureEnsureACL(conn) < 0)
return -1;
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_V3:
case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
case VIR_DRV_FEATURE_MIGRATION_PARAMS:
case VIR_DRV_FEATURE_MIGRATION_P2P:
return 1;
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
default:
return 0;
}
if (virConnectSupportsFeatureEnsureACL(conn) < 0)
return -1;
- switch (feature) {
- case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
- return 1;
- default:
- return 0;
+ switch ((virDrvFeature) feature) {
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ return 1;
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_P2P:
+ case VIR_DRV_FEATURE_MIGRATION_PARAMS:
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_MIGRATION_V3:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
+ default:
+ return 0;
}
}
static int
openvzConnectSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, int feature)
{
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_PARAMS:
case VIR_DRV_FEATURE_MIGRATION_V3:
return 1;
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_P2P:
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
default:
return 0;
}
if (virConnectSupportsFeatureEnsureACL(conn) < 0)
return -1;
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_V2:
case VIR_DRV_FEATURE_MIGRATION_V3:
case VIR_DRV_FEATURE_MIGRATION_P2P:
case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
case VIR_DRV_FEATURE_MIGRATION_PARAMS:
return 1;
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
default:
return 0;
}
remote_connect_supports_feature_ret *ret)
{
int rv = -1;
- int supported;
+ int supported = -1;
struct daemonClientPrivate *priv =
virNetServerClientGetPrivateData(client);
goto cleanup;
}
- switch (args->feature) {
+ switch ((virDrvFeature) args->feature) {
case VIR_DRV_FEATURE_FD_PASSING:
case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
supported = 1;
break;
-
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_MIGRATION_P2P:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_V3:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_PARAMS:
default:
if ((supported = virConnectSupportsFeature(priv->conn, args->feature)) < 0)
goto cleanup;
break;
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ /* should not be possible! */
+ goto cleanup;
}
done:
if (virConnectSupportsFeatureEnsureACL(conn) < 0)
return -1;
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_PARAMS:
case VIR_DRV_FEATURE_MIGRATION_P2P:
return 1;
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_MIGRATION_DIRECT:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_V1:
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_MIGRATION_V3:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
default:
return 0;
}
if (virConnectSupportsFeatureEnsureACL(conn) < 0)
return -1;
- switch (feature) {
+ switch ((virDrvFeature) feature) {
case VIR_DRV_FEATURE_MIGRATION_V1:
case VIR_DRV_FEATURE_MIGRATION_DIRECT:
return 1;
+ case VIR_DRV_FEATURE_MIGRATION_V2:
+ case VIR_DRV_FEATURE_MIGRATION_V3:
+ case VIR_DRV_FEATURE_MIGRATION_P2P:
+ case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
+ case VIR_DRV_FEATURE_FD_PASSING:
+ case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
+ case VIR_DRV_FEATURE_MIGRATION_OFFLINE:
+ case VIR_DRV_FEATURE_MIGRATION_PARAMS:
+ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE:
+ case VIR_DRV_FEATURE_REMOTE:
+ case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK:
+ case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK:
default:
return 0;
}