From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXv2Y-0000oR-Hr for qemu-devel@nongnu.org; Fri, 25 May 2012 09:58:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXv2S-0004wL-4O for qemu-devel@nongnu.org; Fri, 25 May 2012 09:58:50 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:35997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXv2R-0004w5-Rf for qemu-devel@nongnu.org; Fri, 25 May 2012 09:58:44 -0400 Received: by dadv2 with SMTP id v2so1451268dad.4 for ; Fri, 25 May 2012 06:58:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4FBF8DF6.1070206@siemens.com> References: <1337882362-20100-1-git-send-email-zwu.kernel@gmail.com> <1337882362-20100-14-git-send-email-zwu.kernel@gmail.com> <4FBE9B62.1030004@siemens.com> <4FBF8DF6.1070206@siemens.com> Date: Fri, 25 May 2012 21:58:41 +0800 Message-ID: From: Zhi Yong Wu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 13/16] net: Make the monitor output more reasonable hub info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "pbonzini@redhat.com" , "wuzhy@linux.vnet.ibm.com" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , "stefanha@linux.vnet.ibm.com" On Fri, May 25, 2012 at 9:49 PM, Jan Kiszka wrote: > On 2012-05-25 09:00, Zhi Yong Wu wrote: >> On Fri, May 25, 2012 at 4:34 AM, Jan Kiszka wro= te: >>> On 2012-05-24 14:59, zwu.kernel@gmail.com wrote: >>>> From: Zhi Yong Wu >>>> >>>> Signed-off-by: Zhi Yong Wu >>>> --- >>>> =A0net.c =A0 =A0 | =A0 =A07 ++++++- >>>> =A0net/hub.c | =A0 =A02 +- >>>> =A02 files changed, 7 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/net.c b/net.c >>>> index 61dc28d..79ac51f 100644 >>>> --- a/net.c >>>> +++ b/net.c >>>> @@ -887,6 +887,12 @@ static const struct { >>>> =A0 =A0 =A0 =A0 =A0}, >>>> =A0 =A0 =A0}, >>>> =A0#endif /* CONFIG_NET_BRIDGE */ >>>> + =A0 =A0[NET_CLIENT_TYPE_HUB] =3D { >>>> + =A0 =A0 =A0 =A0.type =3D "hubport", >>>> + =A0 =A0 =A0 =A0.desc =3D { >>>> + =A0 =A0 =A0 =A0 =A0 =A0{ /* end of list */ } >>>> + =A0 =A0 =A0 =A0}, >>>> + =A0 =A0}, >>>> =A0}; >>>> >>>> =A0int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) >>>> @@ -1079,7 +1085,6 @@ void do_info_network(Monitor *mon) >>>> =A0 =A0 =A0NetClientState *nc, *peer; >>>> =A0 =A0 =A0net_client_type type; >>>> >>>> - =A0 =A0monitor_printf(mon, "Devices not on any VLAN:\n"); >>>> =A0 =A0 =A0QTAILQ_FOREACH(nc, &net_clients, next) { >>>> =A0 =A0 =A0 =A0 =A0peer =3D nc->peer; >>>> =A0 =A0 =A0 =A0 =A0type =3D nc->info->type; >>>> diff --git a/net/hub.c b/net/hub.c >>>> index 0cc385e..8a583ab 100644 >>>> --- a/net/hub.c >>>> +++ b/net/hub.c >>>> @@ -193,7 +193,7 @@ void net_hub_info(Monitor *mon) >>>> =A0 =A0 =A0QLIST_FOREACH(hub, &hubs, next) { >>>> =A0 =A0 =A0 =A0 =A0monitor_printf(mon, "hub %u\n", hub->id); >>>> =A0 =A0 =A0 =A0 =A0QLIST_FOREACH(port, &hub->ports, next) { >>>> - =A0 =A0 =A0 =A0 =A0 =A0monitor_printf(mon, " =A0 =A0port %u peer %s\= n", port->id, >>>> + =A0 =A0 =A0 =A0 =A0 =A0monitor_printf(mon, " =A0 \\ %s\n", >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 port->nc.peer = ? port->nc.peer->name : ""); >>>> =A0 =A0 =A0 =A0 =A0} >>>> =A0 =A0 =A0} >>> >>> I still do not agree with this formatting (peer -> hubport + hub -> >>> abbreviated peers instead of just hub -> peers). But the series has a >>> higher value than this, and we can fix on top - unless there is a need >>> for another round anyway. >> Can the following formatting let you be happy? >> >> (qemu) info network >> hub 1 >> =A0 =A0\ dump.0: type=3Ddump,dump to qemu-vlan1.pcap (len=3D65536) >> =A0 =A0\ user.1: type=3Duser,net=3D10.0.2.0,restrict=3Doff >> =A0 =A0\ virtio-net-pci.0: type=3Dnic,model=3Dvirtio-net-pci,macaddr=3D5= 2:54:00:12:34:58 >> hub 0 >> =A0 =A0\ user.0: type=3Duser,net=3D10.0.2.0,restrict=3Doff >> =A0 =A0\ e1000.0: type=3Dnic,model=3De1000,macaddr=3D52:54:00:12:34:57 >> virtio-net-pci.1: type=3Dnic,model=3Dvirtio-net-pci,macaddr=3D52:54:00:1= 2:34:56 >> \ ur: type=3Dtap,ifname=3Dtap0,script=3D/etc/qemu-ifup,downscript=3D/etc= /qemu-ifdown > > Yes, this is what I was propose. You can just save the peer indentions > in the hub case. OK. sent out v4 for this patch. > > Thanks! > Jan > > -- > Siemens AG, Corporate Technology, CT T DE IT 1 > Corporate Competence Center Embedded Linux --=20 Regards, Zhi Yong Wu