[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin)
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin) |
Date: |
Fri, 9 Jan 2009 01:25:38 +0100 |
User-agent: |
Mutt/1.5.16 (2007-06-09) |
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 <address@hidden>
> > Signed-off-by: Anthony Liguori <address@hidden>
> >
> > 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);
>