diff options
author | Andrea Bolognani <abologna@redhat.com> | 2022-02-16 18:50:42 +0100 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2022-04-07 18:59:08 +0200 |
commit | a8682ab79150b6eee565478c7febdb3bb12ab64e (patch) | |
tree | 3ddb1b56da94f3be4b0eafeba309729f2122b1cc /src/ch | |
parent | 4e6d0da550ec6a5e830b75603f17e6b9e3f4bb3a (diff) | |
download | libvirt-a8682ab79150b6eee565478c7febdb3bb12ab64e.tar.gz |
drivers: Group global features together
All these features are supposed to be handled by the call to
virDriverFeatureIsGlobal() placed right above the switch
statement, so if any of them is actually encountered inside
the switch statement it means there's a bug in the driver and
we should report an error.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'src/ch')
-rw-r--r-- | src/ch/ch_driver.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index 34ce0c1a0c..d14899044e 100644 --- a/src/ch/ch_driver.c +++ b/src/ch/ch_driver.c @@ -928,23 +928,26 @@ chConnectSupportsFeature(virConnectPtr conn, return supported; switch ((virDrvFeature) feature) { + case VIR_DRV_FEATURE_REMOTE: + case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: + 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_NETWORK_UPDATE_HAS_CORRECT_ORDER: - return 1; + case VIR_DRV_FEATURE_FD_PASSING: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Global feature %d should have already been handled"), + feature); + 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_XML_MIGRATABLE: case VIR_DRV_FEATURE_MIGRATION_OFFLINE: case VIR_DRV_FEATURE_MIGRATION_PARAMS: 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; } |