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