qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Zaborowski <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4885] Remove the NIC from vlan on usb destroy.
Date: Thu, 17 Jul 2008 21:00:07 +0000	[thread overview]
Message-ID: <E1KJaa7-0007Yi-7M@cvs.savannah.gnu.org> (raw)

Revision: 4885
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4885
Author:   balrog
Date:     2008-07-17 21:00:05 +0000 (Thu, 17 Jul 2008)

Log Message:
-----------
Remove the NIC from vlan on usb destroy.

Modified Paths:
--------------
    trunk/hw/usb-net.c
    trunk/net.h
    trunk/vl.c

Modified: trunk/hw/usb-net.c
===================================================================
--- trunk/hw/usb-net.c	2008-07-17 20:47:13 UTC (rev 4884)
+++ trunk/hw/usb-net.c	2008-07-17 21:00:05 UTC (rev 4885)
@@ -1418,7 +1418,8 @@
 {
     USBNetState *s = (USBNetState *) dev;
 
-    /* FIXME: delete the VLAN client and the nic */
+    /* TODO: remove the nd_table[] entry */
+    qemu_del_vlan_client(s->vc);
     rndis_clear_responsequeue(s);
     qemu_free(s);
 }

Modified: trunk/net.h
===================================================================
--- trunk/net.h	2008-07-17 20:47:13 UTC (rev 4884)
+++ trunk/net.h	2008-07-17 21:00:05 UTC (rev 4885)
@@ -28,6 +28,7 @@
                                       IOReadHandler *fd_read,
                                       IOCanRWHandler *fd_can_read,
                                       void *opaque);
+void qemu_del_vlan_client(VLANClientState *vc);
 int qemu_can_send_packet(VLANClientState *vc);
 void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
 void qemu_handler_true(void *opaque);

Modified: trunk/vl.c
===================================================================
--- trunk/vl.c	2008-07-17 20:47:13 UTC (rev 4884)
+++ trunk/vl.c	2008-07-17 21:00:05 UTC (rev 4885)
@@ -3870,6 +3870,19 @@
     return vc;
 }
 
+void qemu_del_vlan_client(VLANClientState *vc)
+{
+    VLANClientState **pvc = &vc->vlan->first_client;
+
+    while (*pvc != NULL)
+        if (*pvc == vc) {
+            *pvc = vc->next;
+            free(vc);
+            break;
+        } else
+            pvc = &(*pvc)->next;
+}
+
 int qemu_can_send_packet(VLANClientState *vc1)
 {
     VLANState *vlan = vc1->vlan;

                 reply	other threads:[~2008-07-17 21:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E1KJaa7-0007Yi-7M@cvs.savannah.gnu.org \
    --to=balrogg@gmail.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).