From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lu7za-0008L8-Hw for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lu7zT-0008HI-VN for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:40 -0400 Received: from [199.232.76.173] (port=54437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lu7zT-0008HA-5c for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:35 -0400 Received: from mail16.svc.cra.dublin.eircom.net ([159.134.118.215]:33252) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Lu7zS-00062f-OB for qemu-devel@nongnu.org; Wed, 15 Apr 2009 12:29:34 -0400 From: Mark McLoughlin Date: Wed, 15 Apr 2009 17:29:28 +0100 Message-Id: <1239812969-8320-9-git-send-email-markmc@redhat.com> In-Reply-To: <1239812969-8320-8-git-send-email-markmc@redhat.com> References: <1239812969-8320-1-git-send-email-markmc@redhat.com> <1239812969-8320-2-git-send-email-markmc@redhat.com> <1239812969-8320-3-git-send-email-markmc@redhat.com> <1239812969-8320-4-git-send-email-markmc@redhat.com> <1239812969-8320-5-git-send-email-markmc@redhat.com> <1239812969-8320-6-git-send-email-markmc@redhat.com> <1239812969-8320-7-git-send-email-markmc@redhat.com> <1239812969-8320-8-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 8/9] Use NICInfo::model for eepro100 savevm ID string Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , qemu-devel@nongnu.org, Mark McLoughlin NICInfo::model will always be identical to the device name strings we're currently passing to nic_init(). Just re-use NICInfo::model. This makes it clear why we use vc->model for unregister_savevm() in a subsequent patch. Signed-off-by: Mark McLoughlin --- hw/eepro100.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index 0a343df..c72b990 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1710,15 +1710,14 @@ static void nic_save(QEMUFile * f, void *opaque) qemu_put_buffer(f, s->configuration, sizeof(s->configuration)); } -static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd, - const char *name, uint32_t device) +static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd, uint32_t device) { PCIEEPRO100State *d; EEPRO100State *s; logout("\n"); - d = (PCIEEPRO100State *) pci_register_device(bus, name, + d = (PCIEEPRO100State *) pci_register_device(bus, nd->model, sizeof(PCIEEPRO100State), -1, NULL, NULL); @@ -1757,24 +1756,23 @@ static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd, qemu_register_reset(nic_reset, s); - register_savevm(name, -1, 3, nic_save, nic_load, s); + register_savevm(s->vc->model, -1, 3, nic_save, nic_load, s); return (PCIDevice *)d; } PCIDevice *pci_i82551_init(PCIBus * bus, NICInfo * nd, int devfn) { - return nic_init(bus, nd, "i82551", i82551); - //~ uint8_t *pci_conf = d->dev.config; + return nic_init(bus, nd, i82551); } PCIDevice *pci_i82557b_init(PCIBus * bus, NICInfo * nd, int devfn) { - return nic_init(bus, nd, "i82557b", i82557B); + return nic_init(bus, nd, i82557B); } PCIDevice *pci_i82559er_init(PCIBus * bus, NICInfo * nd, int devfn) { - return nic_init(bus, nd, "i82559er", i82559ER); + return nic_init(bus, nd, i82559ER); } /* eof */ -- 1.6.0.6