From nobody Sat Nov 1 09:48:45 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 150971878364926.608555024283532; Fri, 3 Nov 2017 07:19:43 -0700 (PDT) Received: from localhost ([::1]:36904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAcoa-00025c-Cl for importer@patchew.org; Fri, 03 Nov 2017 10:19:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAcnk-0001jM-7P for qemu-devel@nongnu.org; Fri, 03 Nov 2017 10:18:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAcnf-0006Wx-VG for qemu-devel@nongnu.org; Fri, 03 Nov 2017 10:18:28 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:57670 helo=mxct.zte.com.cn) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eAcnf-0006N5-K3 for qemu-devel@nongnu.org; Fri, 03 Nov 2017 10:18:23 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 4C0AA9D026B159CDA0B8; Fri, 3 Nov 2017 22:18:15 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id vA3EI6Pl086084; Fri, 3 Nov 2017 22:18:06 +0800 (GMT-8) (envelope-from lu.zhipeng@zte.com.cn) Received: from ceshi.localdomain ([10.74.120.130]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017110322181369-515616 ; Fri, 3 Nov 2017 22:18:13 +0800 From: ZhiPeng Lu To: jasowang@redhat.com Date: Fri, 3 Nov 2017 22:18:05 +0800 Message-Id: <1509718685-7993-1-git-send-email-lu.zhipeng@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-11-03 22:18:13, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-11-03 22:17:51 Content-Transfer-Encoding: quoted-printable X-MAIL: mse01.zte.com.cn vA3EI6Pl086084 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 202.103.147.172 Subject: [Qemu-devel] [PATCH v2] net: add print link status of nic in print_net_client function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ZhiPeng Lu , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We can directly know the information of vm by executing "info network" comm= and, including the link state of nics, without executing other commands again. Signed-off-by: ZhiPeng Lu Reviewed-by: Jiyun Fan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: correct commit messages --- net/net.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 39ef546..9e349cb 100644 --- a/net/net.c +++ b/net/net.c @@ -1298,10 +1298,14 @@ void print_net_client(Monitor *mon, NetClientState = *nc) { NetFilterState *nf; =20 - monitor_printf(mon, "%s: index=3D%d,type=3D%s,%s\n", nc->name, + monitor_printf(mon, "%s: index=3D%d,type=3D%s,%s", nc->name, nc->queue_index, NetClientDriver_str(nc->info->type), nc->info_str); + if (nc->info->type =3D=3D NET_CLIENT_DRIVER_NIC) { + monitor_printf(mon, ",link status:%s", nc->link_down ? "down" : "u= p"); + } + monitor_printf(mon, "\n"); if (!QTAILQ_EMPTY(&nc->filters)) { monitor_printf(mon, "filters:\n"); } --=20 1.8.3.1