Patchwork [10/12] pci: vmstate_register() already assign consecutive numbers starting at 0

login
register
mail settings
Submitter Juan Quintela
Date Dec. 2, 2009, 11:36 a.m.
Message ID <0f750802d3a88725d36d42abce8f48ad9a499dd2.1259753146.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/40004/
State New
Headers show

Comments

Juan Quintela - Dec. 2, 2009, 11:36 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/pci.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 8cf008d..3f855b3 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -161,8 +161,6 @@  PCIBus *pci_find_root_bus(int domain)
 void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
                          const char *name, int devfn_min)
 {
-    static int nbus = 0;
-
     qbus_create_inplace(&bus->qbus, &pci_bus_info, parent, name);
     bus->devfn_min = devfn_min;

@@ -170,7 +168,7 @@  void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
     QLIST_INIT(&bus->child);
     pci_host_bus_register(0, bus); /* for now only pci domain 0 is supported */

-    vmstate_register(nbus++, &vmstate_pcibus, bus);
+    vmstate_register(-1, &vmstate_pcibus, bus);
     qemu_register_reset(pci_bus_reset, bus);
 }