From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58243 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLudE-0004uI-Pq for qemu-devel@nongnu.org; Tue, 08 Jun 2010 04:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLud9-0005AZ-OV for qemu-devel@nongnu.org; Tue, 08 Jun 2010 04:58:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21995) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLud9-0005AO-Gz for qemu-devel@nongnu.org; Tue, 08 Jun 2010 04:57:55 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o588vsr8011796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 8 Jun 2010 04:57:54 -0400 From: Markus Armbruster Date: Tue, 08 Jun 2010 10:57:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Do we still need the hack to set qdev id from NICInfo.name? List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin , Gerd Hoffmann In pci_nic_init(): pci_dev = pci_create(bus, devfn, pci_nic_names[i]); dev = &pci_dev->qdev; if (nd->name) dev->id = qemu_strdup(nd->name); Blatant violation of the DeviceState abstraction. Which even carries a comment advising against this: /* This structure should not be accessed directly. We declare it here so that it can be embedded in individual device state structures. */ struct DeviceState { Do we still need this? Anybody wanting ID can use -device. History: it was added in commit eb54b6dc Author: Gerd Hoffmann Date: Wed Jul 15 13:43:35 2009 +0200 qdev: add id= support for pci nics. and modified to use existing name instead of new id in commit dea7b3b9 Author: Mark McLoughlin Date: Thu Oct 8 19:58:22 2009 +0100 net: remove id field from NICInfo Just use the name field instead since we now use the id paramater as the name, if supplied. Only implication with this change is that if id is not supplied, the value of the name paramater is used as an id.