From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKdzs-0001rS-MD for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:23:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKdzs-0001rA-7Y for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:23:20 -0500 Received: from [199.232.76.173] (port=47632 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKdzr-0001r2-Vs for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:23:20 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:51954) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKdzq-0006c9-Q5 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:23:19 -0500 Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.69) (envelope-from ) id 1LKdzo-0000UQ-Nw for qemu-devel@nongnu.org; Wed, 07 Jan 2009 20:23:17 +0100 Message-ID: <49650123.6010406@mail.berlios.de> Date: Wed, 07 Jan 2009 20:23:15 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [6216] Add a model string to VLANClientState (Mark McLoughlin) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori schrieb: > Revision: 6216 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6216 > Author: aliguori > Date: 2009-01-07 17:42:25 +0000 (Wed, 07 Jan 2009) > > Log Message: > ----------- > Add a model string to VLANClientState (Mark McLoughlin) > > Don't lose track of what type/model a vlan client is so that we can > e.g. assign a global per-model id to clients. > > The entire patch is basically a tedious excercise in making sure the > type/model string gets propagated down to qemu_new_vlan_client(). > > Signed-off-by: Mark McLoughlin > Signed-off-by: Anthony Liguori > > Modified Paths: > -------------- > trunk/hw/e1000.c > trunk/hw/eepro100.c > trunk/hw/etraxfs_eth.c > trunk/hw/mcf_fec.c > trunk/hw/mipsnet.c > trunk/hw/musicpal.c > trunk/hw/ne2000.c > trunk/hw/pcnet.c > trunk/hw/rtl8139.c > trunk/hw/smc91c111.c > trunk/hw/stellaris_enet.c > trunk/hw/usb-net.c > trunk/hw/virtio-net.c > trunk/net.c > trunk/net.h > trunk/sysemu.h > trunk/tap-win32.c > > Modified: trunk/net.c > =================================================================== > --- trunk/net.c 2009-01-07 17:40:15 UTC (rev 6215) > +++ trunk/net.c 2009-01-07 17:42:25 UTC (rev 6216) > @@ -297,6 +297,7 @@ > #endif > > VLANClientState *qemu_new_vlan_client(VLANState *vlan, > + const char *model, > IOReadHandler *fd_read, > IOCanRWHandler *fd_can_read, > void *opaque) > @@ -305,6 +306,7 @@ > vc = qemu_mallocz(sizeof(VLANClientState)); > if (!vc) > return NULL; > + vc->model = strdup(model); > Some targets don't force a value for model, so it can be NULL. This raises a SIGSEGV crash. Should targets set model, or is it better to catch this case here? > vc->fd_read = fd_read; > vc->fd_can_read = fd_can_read; > vc->opaque = opaque; > @@ -325,6 +327,7 @@ > while (*pvc != NULL) > if (*pvc == vc) { > *pvc = vc->next; > + free(vc->model); > free(vc); > break; > } else > > Regards Stefan Weil