]> git.proxmox.com Git - qemu.git/blobdiff - hw/pci/pci-hotplug-old.c
qdev: Drop misleading qdev_free() function
[qemu.git] / hw / pci / pci-hotplug-old.c
index 807728975613b2e5aca33c84e2771f84dc0af828..8dbc3c1cab7606f0cefec574bdf9a482536d042b 100644 (file)
@@ -127,7 +127,7 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
     dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1);
     dinfo->bus = scsibus->busnr;
     scsidev = scsi_bus_legacy_add_drive(scsibus, dinfo->bdrv, dinfo->unit,
-                                        false, -1, NULL);
+                                        false, -1, NULL, NULL);
     if (!scsidev) {
         return -1;
     }
@@ -248,7 +248,7 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
         }
         dev = pci_create(bus, devfn, "virtio-blk-pci");
         if (qdev_prop_set_drive(&dev->qdev, "drive", dinfo->bdrv) < 0) {
-            qdev_free(&dev->qdev);
+            object_unparent(OBJECT(dev));
             dev = NULL;
             break;
         }