From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlTJ3-0007gR-Lv for qemu-devel@nongnu.org; Wed, 09 Sep 2009 15:58:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlTIz-0007ee-0U for qemu-devel@nongnu.org; Wed, 09 Sep 2009 15:58:17 -0400 Received: from [199.232.76.173] (port=41528 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlTIy-0007eZ-Rb for qemu-devel@nongnu.org; Wed, 09 Sep 2009 15:58:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30604) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlTIy-0002ec-2A for qemu-devel@nongnu.org; Wed, 09 Sep 2009 15:58:12 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n89JwAWP005037 for ; Wed, 9 Sep 2009 15:58:10 -0400 Message-ID: <4AA808CF.5010402@redhat.com> Date: Wed, 09 Sep 2009 21:58:07 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 10/12] qdev/isa: convert ne2000 References: <1252507547-11398-1-git-send-email-kraxel@redhat.com> <1252507547-11398-11-git-send-email-kraxel@redhat.com> <877hw8qa7q.fsf@pike.pond.sub.org> In-Reply-To: <877hw8qa7q.fsf@pike.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org >> + >> +void isa_ne2000_init(int base, int irq, NICInfo *nd) > > Nitpick: in qdev parlance, this function is a create_simple, not an > init. Long-term I want zap that anyway ... >> +{ >> + ISADevice *dev; >> + NE2000State *s; >> + >> + qemu_check_nic_model(nd, "ne2k_isa"); >> + >> + dev = isa_create("ne2k_isa"); >> + qdev_prop_set_uint32(&dev->qdev, "iobase", base); >> + qdev_prop_set_uint32(&dev->qdev, "irq", irq); >> + qdev_init(&dev->qdev); >> + > > Shouldn't the rest be in isa_ne2000_initfn()? Think of -device, which > doesn't go through this function... It should. Need to figure a way to handle that nicely though, see below. Right now you can't create a single nic via -device because they are not yet completely qdev-ified. ne2k_isa is no exception here ;) >> + s =&DO_UPCAST(ISANE2000State, dev, dev)->ne2000; >> + memcpy(s->macaddr, nd->macaddr, 6); >> + ne2000_reset(s); /* needs macaddr */ >> + s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, >> + ne2000_can_receive, ne2000_receive, >> + NULL, isa_ne2000_cleanup, s); > > Shouldn't this use qdev_get_vlan_client(), like the other qdevified > NICs? Have a close look at this vlan stuff is on my todo list. Right now it is a big hack. DeviceState->nd must go away, likewise qdev_get_vlan_client() and qdev_get_macaddr(). Instead do something sane using properties. >> +typedef struct ISANE2000State { >> + ISADevice dev; >> + uint32_t iobase; >> + uint32_t isairq; >> + NE2000State ne2000; >> +} ISANE2000State; > > ISANE2000State doesn't belong here, and isn't used as far as I can see. Indeed. cheers, Gerd