diff options
author | Peter Krempa <pkrempa@redhat.com> | 2022-02-16 13:01:39 +0100 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2022-02-17 13:15:46 +0100 |
commit | f24a22315b16cdea3e4ad980e51f856849edb612 (patch) | |
tree | a885756db731d510aec704aecab8184651f2d872 /src/test | |
parent | f3c2b321e0807399551fa96fa2cae0b12e41fdf4 (diff) | |
download | libvirt-f24a22315b16cdea3e4ad980e51f856849edb612.tar.gz |
driver: Introduce global driver feature flag handling function
The 'virDrvFeature' has a combination of features which are asserted by
the specific driver and features which are actually global.
In many cases the implementation was cargo-culted into newer drivers
without re-assesing whether it makes sense.
This patch introduces a global function which will specifically handle
these global flags and defer the rest to the driver.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_driver.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 03c41ca192..4eca5c4a65 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1667,6 +1667,11 @@ static int testConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, int feature) { + int supported; + + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_TYPED_PARAM_STRING: case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: |