From 7c03b3050e69ba858f772fb0bf76abc4a93f8dfb Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 30 Jun 2025 22:38:18 +0200 Subject: [PATCH] manager: add a capability for "sriov.preserve-on-down" Add a new capability to indicate that NetworkManager supports the "sriov.preserve-on-down" connection property. With this, clients can set the property only when supported, without the risk of creating an invalid connection. (cherry picked from commit 8e40f7e289c94f578f04bb8661d70eca503bcee6) --- src/core/nm-manager.c | 3 ++- src/libnm-core-public/nm-dbus-interface.h | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index 03e0c1fa24..fce3707125 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -479,7 +479,8 @@ _version_info_get(void) * with index 0-31 goes to element #1, with index 32-63 to element #2, * with index 64-95 to element #3 and so on. */ (1 << NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE) - | (1 << NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING), + | (1 << NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING) + | (1 << NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN), }; return nm_g_variant_new_au(arr, G_N_ELEMENTS(arr)); diff --git a/src/libnm-core-public/nm-dbus-interface.h b/src/libnm-core-public/nm-dbus-interface.h index 27facc4780..78241193a4 100644 --- a/src/libnm-core-public/nm-dbus-interface.h +++ b/src/libnm-core-public/nm-dbus-interface.h @@ -101,6 +101,8 @@ * https://issues.redhat.com/browse/RHEL-67324 * @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports * configuring per-device IPv4 sysctl forwarding setting. Since: 1.54. + * @NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN: NetworkManager supports the + * "sriov.preserve-on-down" property. Since: 1.54 * * The numeric values represent the bit index of the capability. These capabilities * can be queried in the "VersionInfo" D-Bus property. @@ -108,8 +110,9 @@ * Since: 1.42 */ typedef enum { - NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE = 0, - NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING = 1, + NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE = 0, + NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING = 1, + NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN = 2, } NMVersionInfoCapability; /**