From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL56U-0008PS-TF for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:19:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL56Q-0008PG-Au for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:19:57 -0500 Received: from [199.232.76.173] (port=56998 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL56Q-0008PD-5B for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:19:54 -0500 Received: from bart.se.axis.com ([195.60.68.10]:58747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LL56P-0004FW-QW for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:19:54 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id B894764101 for ; Fri, 9 Jan 2009 01:19:51 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id 9610F640F6 for ; Fri, 9 Jan 2009 01:19:51 +0100 (CET) Date: Fri, 9 Jan 2009 01:19:51 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin) Message-ID: <20090109001951.GA29388@edgar.se.axis.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , markmc@redhat.com Cc: qemu-devel@nongnu.org On Thu, Jan 08, 2009 at 07:44:06PM +0000, Anthony Liguori wrote: > Revision: 6247 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6247 > Author: aliguori > Date: 2009-01-08 19:44:06 +0000 (Thu, 08 Jan 2009) > > Log Message: > ----------- > Add 'set_link' monitor command (Mark McLoughlin) > > Add a monitor command to setting a given network device's link status > to 'up' or 'down'. > > Allows simulation of network cable disconnect. > > Signed-off-by: Mark McLoughlin > Signed-off-by: Anthony Liguori > > Modified Paths: > -------------- > trunk/monitor.c > trunk/net.c > trunk/net.h > > +int do_set_link(const char *name, const char *up_or_down) > +{ > + VLANState *vlan; > + VLANClientState *vc = NULL; > + > + for (vlan = first_vlan; vlan != NULL; vlan = vlan->next) > + for (vc = vlan->first_client; vc != NULL; vc = vc->next) > + if (strcmp(vc->name, name) == 0) > + break; Hello, I ran into an issue here with the etrax boards. set_link does not handle multiple nics on the same vlan. I'd like to apply the following soon unless someone objects. Best regards diff --git a/net.c b/net.c index fa9fa94..0bb38e4 100644 --- a/net.c +++ b/net.c @@ -1703,7 +1703,8 @@ int do_set_link(const char *name, const char *up_or_down) for (vlan = first_vlan; vlan != NULL; vlan = vlan->next) for (vc = vlan->first_client; vc != NULL; vc = vc->next) if (strcmp(vc->name, name) == 0) - break; + goto done; +done: if (!vc) { term_printf("could not find network device '%s'", name);