From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9xqd-0008WD-OJ for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:26:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9xqZ-0008Vi-HR for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:26:11 -0500 Received: from [199.232.76.173] (port=38294 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9xqZ-0008Vf-Do for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:26:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3097) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9xqY-0000yi-Vj for qemu-devel@nongnu.org; Mon, 16 Nov 2009 04:26:07 -0500 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 nAG9Q6QV009641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Nov 2009 04:26:06 -0500 Message-ID: <4B011AA9.1060301@redhat.com> Date: Mon, 16 Nov 2009 10:26:01 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <1258057742-18699-1-git-send-email-markmc@redhat.com> <1258057742-18699-4-git-send-email-markmc@redhat.com> In-Reply-To: <1258057742-18699-4-git-send-email-markmc@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/7] net: create the VLANClientState for NICs early List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org, quintela@redhat.com Hi, > diff --git a/hw/e1000.c b/hw/e1000.c > index 00f6a57..d9c9f79 100644 > --- a/hw/e1000.c > +++ b/hw/e1000.c > @@ -1107,11 +1107,11 @@ static int pci_e1000_init(PCIDevice *pci_dev) > checksum = (uint16_t) EEPROM_SUM - checksum; > d->eeprom_data[EEPROM_CHECKSUM_REG] = checksum; > > - d->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, > - d->conf.vlan, d->conf.peer, > - d->dev.qdev.info->name, d->dev.qdev.id, > - e1000_can_receive, e1000_receive, NULL, > - NULL, e1000_cleanup, d); > + d->vc = d->conf.client; > + d->vc->opaque = d; > + d->vc->can_receive = e1000_can_receive; > + d->vc->receive = e1000_receive; > + d->vc->cleanup = e1000_cleanup; > d->vc->link_status_changed = e1000_set_link_status; > > qemu_format_nic_info_str(d->vc, macaddr); ... and now -device $nic,args is completely broken. There are netdev, vlan and net-client properties but none of them will work. If you want to have net.c prepare vlanclientstate (there might be good reasons for it), then it must be properly: * Create a named vlanclientstate. * Have drivers lookup the vlanclientstate by name. Pretty much like the netdev peer lookup works today, only with the difference that it is used directly instead of being passed as peer on vlanclient creation. i.e. something like -netdev client,id=foo, -device e1000,client=foo,mac=11:22:33:44:55:66 It is probably a good idea to zap the vlan and netdev properties then, so we don't have tons of different ways to setup a nic. Fortunaly we had no release with the vlan+netdev properties yet, so this shouldn't be a backward compatibility issue IMHO. Also take care that the creation and destruction is symmetric. If net.c creates the vlanclient it should also net.c's job to clean it up, i.e. all the qemu_del_vlan_client() calls in the nic drivers should go away, otherwise hotplug will have some unpleasant surprises for you. cheers, Gerd