Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL5C0-0001AR-Je for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:25:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL5Bz-00019p-Ik for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:25:39 -0500 Received: from [199.232.76.173] (port=45209 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL5Bz-00019m-GU for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:25:39 -0500 Received: from bart.se.axis.com ([195.60.68.10]:58980) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LL5Bz-0004lw-24 for qemu-devel@nongnu.org; Thu, 08 Jan 2009 19:25:39 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id 54987640CD for ; Fri, 9 Jan 2009 01:25:38 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id 43D73640B9 for ; Fri, 9 Jan 2009 01:25:38 +0100 (CET) Date: Fri, 9 Jan 2009 01:25:38 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin) Message-ID: <20090109002538.GB29388@edgar.se.axis.com> References: <20090109001951.GA29388@edgar.se.axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090109001951.GA29388@edgar.se.axis.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: markmc@redhat.com, qemu-devel@nongnu.org On Fri, Jan 09, 2009 at 01:19:51AM +0100, Edgar E. Iglesias wrote: > 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. ^^^^ different vlans > 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); >