Commit 32a8f6ae93f175518f86f99249177c35d1a85114

Authored by aliguori
1 parent 41bd13af

Use NICInfo::model for eepro100 savevm ID string (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 <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7149 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 8 deletions
hw/eepro100.c
... ... @@ -1710,15 +1710,14 @@ static void nic_save(QEMUFile * f, void *opaque)
1710 1710 qemu_put_buffer(f, s->configuration, sizeof(s->configuration));
1711 1711 }
1712 1712  
1713   -static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd,
1714   - const char *name, uint32_t device)
  1713 +static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd, uint32_t device)
1715 1714 {
1716 1715 PCIEEPRO100State *d;
1717 1716 EEPRO100State *s;
1718 1717  
1719 1718 logout("\n");
1720 1719  
1721   - d = (PCIEEPRO100State *) pci_register_device(bus, name,
  1720 + d = (PCIEEPRO100State *) pci_register_device(bus, nd->model,
1722 1721 sizeof(PCIEEPRO100State), -1,
1723 1722 NULL, NULL);
1724 1723  
... ... @@ -1757,24 +1756,23 @@ static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd,
1757 1756  
1758 1757 qemu_register_reset(nic_reset, s);
1759 1758  
1760   - register_savevm(name, -1, 3, nic_save, nic_load, s);
  1759 + register_savevm(s->vc->model, -1, 3, nic_save, nic_load, s);
1761 1760 return (PCIDevice *)d;
1762 1761 }
1763 1762  
1764 1763 PCIDevice *pci_i82551_init(PCIBus * bus, NICInfo * nd, int devfn)
1765 1764 {
1766   - return nic_init(bus, nd, "i82551", i82551);
1767   - //~ uint8_t *pci_conf = d->dev.config;
  1765 + return nic_init(bus, nd, i82551);
1768 1766 }
1769 1767  
1770 1768 PCIDevice *pci_i82557b_init(PCIBus * bus, NICInfo * nd, int devfn)
1771 1769 {
1772   - return nic_init(bus, nd, "i82557b", i82557B);
  1770 + return nic_init(bus, nd, i82557B);
1773 1771 }
1774 1772  
1775 1773 PCIDevice *pci_i82559er_init(PCIBus * bus, NICInfo * nd, int devfn)
1776 1774 {
1777   - return nic_init(bus, nd, "i82559er", i82559ER);
  1775 + return nic_init(bus, nd, i82559ER);
1778 1776 }
1779 1777  
1780 1778 /* eof */
... ...