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.