From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKw8n-0006rr-Lp for qemu-devel@nongnu.org; Thu, 08 Jan 2009 09:45:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKw8m-0006qL-6c for qemu-devel@nongnu.org; Thu, 08 Jan 2009 09:45:44 -0500 Received: from [199.232.76.173] (port=37741 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKw8m-0006qI-0S for qemu-devel@nongnu.org; Thu, 08 Jan 2009 09:45:44 -0500 Received: from mx2.redhat.com ([66.187.237.31]:33793) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKw8l-0007Ym-H1 for qemu-devel@nongnu.org; Thu, 08 Jan 2009 09:45:43 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n08EjgV5024437 for ; Thu, 8 Jan 2009 09:45:42 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n08Ejg1h029873 for ; Thu, 8 Jan 2009 09:45:43 -0500 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n08EjfdP020934 for ; Thu, 8 Jan 2009 09:45:42 -0500 Subject: Re: [Qemu-devel] [6216] Add a model string to VLANClientState (Mark McLoughlin) From: Mark McLoughlin In-Reply-To: <49650123.6010406@mail.berlios.de> References: <49650123.6010406@mail.berlios.de> Content-Type: text/plain Date: Thu, 08 Jan 2009 14:45:39 +0000 Message-Id: <1231425939.4296.79.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin , 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 On Wed, 2009-01-07 at 20:23 +0100, Stefan Weil wrote: > 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: 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? Ouch. It'd be much nicer to make sure we always get a model string here rather than having names default to e.g. "nic.1". So, I went and fixed up all the targets to make sure that nd->model is always set. That sucked, though, so I went through a couple of iterations of cleaning all this stuff up and settled on the patches that follow this mail. Cheers, Mark.