qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH RFC 3/4] hmp: Add netdev information into output of hmp cmd "info


From: huangy81
Subject: [PATCH RFC 3/4] hmp: Add netdev information into output of hmp cmd "info network"
Date: Tue, 1 Nov 2022 00:19:01 +0800

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

Add netdev information into output of hmp command hmp_info_network
so developers can analyze interface capability more easily.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
---
 net/net.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/net/net.c b/net/net.c
index c27ebfa..9325628 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1330,6 +1330,21 @@ void print_net_client(Monitor *mon, NetClientState *nc)
                    nc->queue_index,
                    NetClientDriver_str(nc->info->type),
                    nc->info_str);
+    if (nc->info->type != NET_CLIENT_DRIVER_NIC) {
+        NetDevInfo *info = query_netdev(nc);
+        if (info) {
+            monitor_printf(mon, "netdev info: ufo=%s, vnet-hdr=%s, "
+                "vnet-hdr-len=%s", info->ufo ? "on" : "off",
+                info->vnet_hdr ? "on" : "off",
+                info->vnet_hdr_len ? "on" : "off");
+            if (info->has_acked_features) {
+                monitor_printf(mon, ", acked-features=0x%" PRIx64,
+                    info->acked_features);
+            }
+            monitor_printf(mon, "\n");
+            g_free(info);
+        }
+    }
     if (!QTAILQ_EMPTY(&nc->filters)) {
         monitor_printf(mon, "filters:\n");
     }
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]