Make AddressSpaces QOM objects to ensure that they are destroyed when
their owners are finalized and also to get a unique path for debugging
output.

The name arguments were used to distinguish AddresSpaces in debugging
output, but they will represent property names after QOM-ification and
debugging output will show QOM paths. So change them to make them more
concise and also avoid conflicts with other properties.

Signed-off-by: Akihiko Odaki <od...@rsg.ci.i.u-tokyo.ac.jp>
---
 hw/scsi/lsi53c895a.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index ee21b3c0d08a..b577f5ba2282 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -2356,8 +2356,8 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
     s->ram_io.disable_reentrancy_guard = true;
     s->mmio_io.disable_reentrancy_guard = true;
 
-    address_space_init(&s->pci_io_as, NULL, pci_address_space_io(dev),
-                       "lsi-pci-io");
+    address_space_init(&s->pci_io_as, OBJECT(s), pci_address_space_io(dev),
+                       "io-as");
     qdev_init_gpio_out(d, &s->ext_irq, 1);
 
     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_io);
@@ -2372,7 +2372,7 @@ static void lsi_scsi_exit(PCIDevice *dev)
 {
     LSIState *s = LSI53C895A(dev);
 
-    address_space_destroy(&s->pci_io_as);
+    object_unparent(OBJECT(&s->pci_io_as));
     timer_free(s->scripts_timer);
 }
 

-- 
2.51.0


Reply via email to