nmcli: show sriov capability in "nmcli" output

This is sometimes interesting to know.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1431
This commit is contained in:
Lubomir Rintel
2022-10-11 19:22:37 +02:00
parent 2513503dc2
commit b784da83d2

View File

@@ -1301,6 +1301,7 @@ device_overview(NmCli *nmc, NMDevice *device)
GString *outbuf = g_string_sized_new(80); GString *outbuf = g_string_sized_new(80);
char *tmp; char *tmp;
const GPtrArray *activatable; const GPtrArray *activatable;
NMDeviceCapabilities caps;
activatable = nm_device_get_available_connections(device); activatable = nm_device_get_available_connections(device);
@@ -1378,10 +1379,13 @@ device_overview(NmCli *nmc, NMDevice *device)
break; break;
} }
if (nm_device_is_software(device)) caps = nm_device_get_capabilities(device);
if (caps & NM_DEVICE_CAP_IS_SOFTWARE)
g_string_append_printf(outbuf, "%s, ", _("sw")); g_string_append_printf(outbuf, "%s, ", _("sw"));
else else
g_string_append_printf(outbuf, "%s, ", _("hw")); g_string_append_printf(outbuf, "%s, ", _("hw"));
if (caps & NM_DEVICE_CAP_SRIOV)
g_string_append_printf(outbuf, "%s, ", _("sriov"));
if (!NM_IN_STRSET(nm_device_get_ip_iface(device), NULL, nm_device_get_iface(device))) if (!NM_IN_STRSET(nm_device_get_ip_iface(device), NULL, nm_device_get_iface(device)))
g_string_append_printf(outbuf, "%s %s, ", _("iface"), nm_device_get_ip_iface(device)); g_string_append_printf(outbuf, "%s %s, ", _("iface"), nm_device_get_ip_iface(device));