diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index ff85590..d9c2436 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -491,7 +491,7 @@ static int assigned_dev_register_regions(PCIRegion *io_regions,
                                            name, cur_region->size,
                                            virtbase);
                 vmstate_register_ram(&pci_dev->v_addrs[i].real_iomem,
-                                     &pci_dev->dev.qdev);
+                                     DEVICE(&pci_dev->dev));
             }
 
             assigned_dev_iomem_setup(&pci_dev->dev, i, cur_region->size);
@@ -817,6 +817,7 @@ fail:
 
 static int assign_device(AssignedDevice *dev)
 {
+    DeviceState *d = DEVICE(&dev->dev);
     uint32_t flags = KVM_DEV_ASSIGN_ENABLE_IOMMU;
     int r;
 
@@ -830,7 +831,7 @@ static int assign_device(AssignedDevice *dev)
 
     if (!kvm_check_extension(kvm_state, KVM_CAP_IOMMU)) {
         error_report("No IOMMU found.  Unable to assign device \"%s\"",
-                     dev->dev.qdev.id);
+                     d->id);
         return -ENODEV;
     }
 
@@ -842,7 +843,7 @@ static int assign_device(AssignedDevice *dev)
     r = kvm_device_pci_assign(kvm_state, &dev->host, flags, &dev->dev_id);
     if (r < 0) {
         error_report("Failed to assign device \"%s\" : %s",
-                     dev->dev.qdev.id, strerror(-r));
+                     d->id, strerror(-r));
 
         switch (r) {
         case -EBUSY:
@@ -867,6 +868,7 @@ static bool check_irqchip_in_kernel(void)
 
 static int assign_intx(AssignedDevice *dev)
 {
+    DeviceState *d = DEVICE(&dev->dev);
     AssignedIRQType new_type;
     PCIINTxRoute intx_route;
     bool intx_host_msi;
@@ -942,7 +944,7 @@ retry:
             goto retry;
         }
         error_report("Failed to assign irq for \"%s\": %s",
-                     dev->dev.qdev.id, strerror(-r));
+                     d->id, strerror(-r));
         error_report("Perhaps you are assigning a device "
                      "that shares an IRQ with another device?");
         return r;
@@ -972,7 +974,7 @@ static void assigned_dev_update_irq_routing(PCIDevice *dev)
 
     r = assign_intx(assigned_dev);
     if (r < 0) {
-        qdev_unplug(&dev->qdev, &err);
+        qdev_unplug(DEVICE(dev), &err);
         assert(!err);
     }
 }
@@ -1675,7 +1677,7 @@ static const VMStateDescription vmstate_assigned_device = {
 
 static void reset_assigned_device(DeviceState *dev)
 {
-    PCIDevice *pci_dev = DO_UPCAST(PCIDevice, qdev, dev);
+    PCIDevice *pci_dev = PCI_DEVICE(dev);
     AssignedDevice *adev = DO_UPCAST(AssignedDevice, dev, pci_dev);
     char reset_file[64];
     const char reset[] = "1";
@@ -1731,6 +1733,7 @@ static void reset_assigned_device(DeviceState *dev)
 
 static int assigned_initfn(struct PCIDevice *pci_dev)
 {
+    DeviceState *d = DEVICE(pci_dev);
     AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
     uint8_t e_intx;
     int r;
@@ -1769,7 +1772,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
     if (get_real_device(dev, dev->host.domain, dev->host.bus,
                         dev->host.slot, dev->host.function)) {
         error_report("pci-assign: Error: Couldn't get real device (%s)!",
-                     dev->dev.qdev.id);
+                     d->id);
         goto out;
     }
 
@@ -1811,7 +1814,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
 
     assigned_dev_load_option_rom(dev);
 
-    add_boot_device_path(dev->bootindex, &pci_dev->qdev, NULL);
+    add_boot_device_path(dev->bootindex, d, NULL);
 
     return 0;
 
@@ -1916,7 +1919,7 @@ static void assigned_dev_load_option_rom(AssignedDevice *dev)
     snprintf(name, sizeof(name), "%s.rom",
             object_get_typename(OBJECT(dev)));
     memory_region_init_ram(&dev->dev.rom, name, st.st_size);
-    vmstate_register_ram(&dev->dev.rom, &dev->dev.qdev);
+    vmstate_register_ram(&dev->dev.rom, DEVICE(&dev->dev));
     ptr = memory_region_get_ram_ptr(&dev->dev.rom);
     memset(ptr, 0xff, st.st_size);
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4844a6b..120f02c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1085,10 +1085,10 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
 
     if (pci_bus) {
         PCIDevice *pcidev = pci_vga_init(pci_bus);
-        dev = pcidev ? &pcidev->qdev : NULL;
+        dev = DEVICE(pcidev);
     } else if (isa_bus) {
         ISADevice *isadev = isa_vga_init(isa_bus);
-        dev = isadev ? &isadev->qdev : NULL;
+        dev = DEVICE(isadev);
     }
     return dev;
 }
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index d618570..1b40f24 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -191,8 +191,8 @@ static void pc_init1(MemoryRegion *system_memory,
         } else {
             dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
         }
-        idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
-        idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
+        idebus[0] = qdev_get_child_bus(DEVICE(dev), "ide.0");
+        idebus[1] = qdev_get_child_bus(DEVICE(dev), "ide.1");
     } else {
         for(i = 0; i < MAX_IDE_BUS; i++) {
             ISADevice *dev;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7888dfe..ff48bbf 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -179,8 +179,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
                                            PCI_DEVFN(ICH9_SATA1_DEV,
                                                      ICH9_SATA1_FUNC),
                                            true, "ich9-ahci");
-    idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
-    idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
+    idebus[0] = qdev_get_child_bus(DEVICE(ahci), "ide.0");
+    idebus[1] = qdev_get_child_bus(DEVICE(ahci), "ide.1");
 
     if (usb_enabled(false)) {
         /* Should we create 6 UHCI according to ich9 spec? */
