qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@axis.com>
To: Anthony Liguori <anthony@codemonkey.ws>, markmc@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin)
Date: Fri, 9 Jan 2009 01:19:51 +0100	[thread overview]
Message-ID: <20090109001951.GA29388@edgar.se.axis.com> (raw)
In-Reply-To: <E1LL0nW-0007EB-Jp@cvs.savannah.gnu.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 <markmc@redhat.com>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> 
> 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);

  reply	other threads:[~2009-01-09  0:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 19:44 [Qemu-devel] [6247] Add 'set_link' monitor command (Mark McLoughlin) Anthony Liguori
2009-01-09  0:19 ` Edgar E. Iglesias [this message]
2009-01-09  0:25   ` Edgar E. Iglesias
2009-01-09  0:41   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090109001951.GA29388@edgar.se.axis.com \
    --to=edgar.iglesias@axis.com \
    --cc=anthony@codemonkey.ws \
    --cc=markmc@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).