From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvWvn-0008EN-7J for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:51:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvWvh-00088X-Bp for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:51:50 -0400 Received: from [199.232.76.173] (port=49474 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvWvg-00088J-Vs for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:51:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25983) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvWvg-00087T-EE for qemu-devel@nongnu.org; Wed, 07 Oct 2009 09:51:44 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n97DphNr000627 for ; Wed, 7 Oct 2009 09:51:43 -0400 Subject: Re: [Qemu-devel] [RFC PATCH v2 4/5] ne2k_isa: qdev-ify. From: Mark McLoughlin In-Reply-To: <1254918996-26050-5-git-send-email-kraxel@redhat.com> References: <1254918996-26050-1-git-send-email-kraxel@redhat.com> <1254918996-26050-5-git-send-email-kraxel@redhat.com> Content-Type: text/plain Date: Wed, 07 Oct 2009 14:50:07 +0100 Message-Id: <1254923407.2887.16.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On Wed, 2009-10-07 at 14:36 +0200, Gerd Hoffmann wrote: > - s->vc = qdev_get_vlan_client(&dev->qdev, > - ne2000_can_receive, ne2000_receive, NULL, > - isa_ne2000_cleanup, s); > - qemu_format_nic_info_str(s->vc, s->macaddr); > + if (s->vlan != -1) { > + s->vc = qemu_new_vlan_client(qemu_find_vlan(s->vlan, 1), > + dev->qdev.info->name, dev->qdev.id, > + ne2000_can_receive, ne2000_receive, NULL, > + isa_ne2000_cleanup, s); > + qemu_format_nic_info_str(s->vc, s->macaddr); > + } else { > + qemu_error("warning: no vlan specfied, ne2k_isa is unconnected\n"); > + } I'll be posting a patch later which allows qemu_new_vlan_client() to take a NULL vlan thereafter drop any packets passed to it. I think that makes more sense, as VLANClientState should become a NetClient structure which can represent a NIC, backend or even a vlan itself. Cheers, Mark.