forked from rpms/libvirt
82 lines
2.8 KiB
Diff
82 lines
2.8 KiB
Diff
From d6c2ed7802c150c9bd2d125e5757aabff5f75d05 Mon Sep 17 00:00:00 2001
|
|
Message-Id: <d6c2ed7802c150c9bd2d125e5757aabff5f75d05@dist-git>
|
|
From: Michal Privoznik <mprivozn@redhat.com>
|
|
Date: Mon, 10 Jan 2022 12:08:07 +0100
|
|
Subject: [PATCH] network: Implement virConnectSupportsFeature()
|
|
|
|
So far, it was not needed, but shortly a client will want to know
|
|
whether virNetworkUpdate() API is fixed or not. See next commits
|
|
for more info.
|
|
|
|
Side note, this driver's implementation is called only when using
|
|
sub-driver's connection, i.e. "network:///system". For any other
|
|
URI the corresponding hypervisor's driver callback is called.
|
|
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
|
(cherry picked from commit 94741bc53e9b9a405fae8f2e96b780c2891b2ff0)
|
|
|
|
Conflicts:
|
|
- src/network/bridge_driver.c: Well, context. The code in
|
|
RHEL-8.5.0 is very old and this commit is very new. It's
|
|
nothing unexpected.
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=2038812
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Message-Id: <9f53a76a7bdeac4e4d85aace8f8dcbe008bc25df.1641812574.git.mprivozn@redhat.com>
|
|
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
|
---
|
|
src/network/bridge_driver.c | 29 +++++++++++++++++++++++++++++
|
|
1 file changed, 29 insertions(+)
|
|
|
|
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
|
|
index b8118067d1..703348888a 100644
|
|
--- a/src/network/bridge_driver.c
|
|
+++ b/src/network/bridge_driver.c
|
|
@@ -961,6 +961,34 @@ static int networkConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED)
|
|
}
|
|
|
|
|
|
+static int
|
|
+networkConnectSupportsFeature(virConnectPtr conn, int feature)
|
|
+{
|
|
+ if (virConnectSupportsFeatureEnsureACL(conn) < 0)
|
|
+ return -1;
|
|
+
|
|
+ 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_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_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;
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
/* networkKillDaemon:
|
|
*
|
|
* kill the specified pid/name, and wait a bit to make sure it's dead.
|
|
@@ -5824,6 +5852,7 @@ static virHypervisorDriver networkHypervisorDriver = {
|
|
.connectIsEncrypted = networkConnectIsEncrypted, /* 4.1.0 */
|
|
.connectIsSecure = networkConnectIsSecure, /* 4.1.0 */
|
|
.connectIsAlive = networkConnectIsAlive, /* 4.1.0 */
|
|
+ .connectSupportsFeature = networkConnectSupportsFeature, /* 7.2.0 */
|
|
};
|
|
|
|
|
|
--
|
|
2.34.1
|
|
|