From b3a37609be71fd8b26f4e5af15dcf9444c29412b Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 11 Oct 2022 19:22:37 +0200 Subject: nmcli: show sriov capability in "nmcli" output This is sometimes interesting to know. --- src/nmcli/general.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nmcli/general.c b/src/nmcli/general.c index d116ab2c83..54985ce086 100644 --- a/src/nmcli/general.c +++ b/src/nmcli/general.c @@ -1301,6 +1301,7 @@ device_overview(NmCli *nmc, NMDevice *device) GString *outbuf = g_string_sized_new(80); char *tmp; const GPtrArray *activatable; + NMDeviceCapabilities caps; activatable = nm_device_get_available_connections(device); @@ -1378,10 +1379,13 @@ device_overview(NmCli *nmc, NMDevice *device) 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")); else 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))) g_string_append_printf(outbuf, "%s %s, ", _("iface"), nm_device_get_ip_iface(device)); -- cgit v1.2.1