qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 02/27] bootindex: add del_boot_device_path fu


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH v6 02/27] bootindex: add del_boot_device_path function
Date: Thu, 4 Sep 2014 12:06:07 +0000

Hi,

> 
> I've confirmed that this is a bug, and have posted a patch fix it.
> 
> Please review, thanks!
> 
> [PATCH] virtio-pci: fix virtio-net child refcount in transports
> 
> Best regards,
> -Gonglei

So, about Gerd's previous question:

> When hot-unplugging virtio-net-pci I'd expect we free both
> virtio-net-pci and virtio-net-device (and therefore call
> del_boot_device_path twice, once for each device).  Can you check that?
>  
After fix that bug, you are right. The del_boot_device_path will be called 
twice.
I can rework del_boot_device_path(), remove is_same_fw_dev_path().

The new del_boot_device_path function as below:

void del_boot_device_path(DeviceState *dev)
{
    FWBootEntry *i;

    assert(dev != NULL);

    /* remove all entries of the assigned device */
    QTAILQ_FOREACH(i, &fw_boot_order, link) {
        if (i->dev == NULL) {
            continue;
        }
        if (i->dev == dev) {
            QTAILQ_REMOVE(&fw_boot_order, i, link);
            g_free(i->suffix);
            g_free(i);

            break;
        }
    }
}

Best regards,
-Gonglei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]