[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qdev: rename qdev_free() to qdev_unparent()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] qdev: rename qdev_free() to qdev_unparent() |
Date: |
Wed, 11 Sep 2013 13:52:36 +0200 |
On Wed, Sep 11, 2013 at 10:23 AM, Andreas Färber <address@hidden> wrote:
> Am 11.09.2013 09:45, schrieb Stefan Hajnoczi:
>> diff --git a/hw/pci/pci-hotplug-old.c b/hw/pci/pci-hotplug-old.c
>> index 619fe47..f197f5f 100644
>> --- a/hw/pci/pci-hotplug-old.c
>> +++ b/hw/pci/pci-hotplug-old.c
>> @@ -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);
>> + qdev_unparent(&dev->qdev);
>
> This should be DEVICE(dev), making most callers outside qdev.c do a cast
> after all.
>
> Also we should name the function device_unparent if we decide to keep it
> around.
This is true. We should probably just use object_unref(OBJECT(foo)) everywhere.
I'll drop qdev_free() completely and resend.
Stefan